fixed calendar for empty timesheet descriptions (#265)

This commit is contained in:
Kevin Papst
2018-08-10 08:19:30 +02:00
committed by GitHub
parent c6e99b35d5
commit fb2d898e4c
3 changed files with 18 additions and 4 deletions

View File

@@ -155,7 +155,7 @@ class TimesheetEntity
/**
* @return string
*/
public function getDescription(): string
public function getDescription(): ?string
{
return $this->description;
}

View File

@@ -66,10 +66,18 @@ class TimesheetFixtures extends Fixture implements DependentFixtureInterface
if ($i > self::MAX_TIMESHEETS_TOTAL) {
break;
}
$description = null;
if ($i % 3 == 0) {
$description = $faker->text;
} elseif ($i % 7 == 0) {
$description = '';
}
$entry = $this->createTimesheetEntry(
$user,
$activities[array_rand($activities)],
($i % 3 == 0 ? $faker->text : ''),
$description,
round($i / 2),
true
);
@@ -89,7 +97,7 @@ class TimesheetFixtures extends Fixture implements DependentFixtureInterface
$entry = $this->createTimesheetEntry(
$user,
$activities[array_rand($activities)],
$faker->text
null
);
$manager->persist($entry);
}