Code improvements (#1649)

* use global namespace for faster lookups
* phpstan level 5
This commit is contained in:
Kevin Papst
2020-04-19 14:37:14 +02:00
committed by GitHub
parent 7b25e9acaf
commit 0f3fa8fdbe
183 changed files with 604 additions and 574 deletions

View File

@@ -123,7 +123,7 @@ final class ActivityFixtures extends Fixture
;
if (null !== $this->callback) {
call_user_func($this->callback, $activity);
\call_user_func($this->callback, $activity);
}
$manager->persist($activity);
}

View File

@@ -89,7 +89,7 @@ final class CustomerFixtures extends Fixture
;
if (null !== $this->callback) {
call_user_func($this->callback, $customer);
\call_user_func($this->callback, $customer);
}
$manager->persist($customer);
}

View File

@@ -106,7 +106,7 @@ final class ProjectFixtures extends Fixture
;
if (null !== $this->callback) {
call_user_func($this->callback, $project);
\call_user_func($this->callback, $project);
}
$manager->persist($project);
}

View File

@@ -68,7 +68,7 @@ final class TagFixtures extends Fixture
$tag = $this->createTagEntry($tagName);
if (null !== $this->callback) {
call_user_func($this->callback, $tag);
\call_user_func($this->callback, $tag);
}
$manager->persist($tag);
}

View File

@@ -101,7 +101,7 @@ final class TeamFixtures extends Fixture
$lead = null;
while (null === $lead) {
$tmp = $user[array_rand($user)];
if (!in_array($tmp, $this->skipUser)) {
if (!\in_array($tmp, $this->skipUser)) {
$lead = $tmp;
}
}
@@ -116,7 +116,7 @@ final class TeamFixtures extends Fixture
$userToAdd = null;
while (null === $userToAdd) {
$tmp = $user[array_rand($user)];
if (!in_array($tmp, $this->skipUser)) {
if (!\in_array($tmp, $this->skipUser)) {
$userToAdd = $tmp;
}
}
@@ -128,7 +128,7 @@ final class TeamFixtures extends Fixture
}
if (null !== $this->callback) {
call_user_func($this->callback, $team);
\call_user_func($this->callback, $team);
}
$manager->persist($team);
}

View File

@@ -241,7 +241,7 @@ final class TimesheetFixtures extends Fixture
);
if (null !== $this->callback) {
call_user_func($this->callback, $timesheet);
\call_user_func($this->callback, $timesheet);
}
$manager->persist($timesheet);
}
@@ -267,7 +267,7 @@ final class TimesheetFixtures extends Fixture
);
if (null !== $this->callback) {
call_user_func($this->callback, $timesheet);
\call_user_func($this->callback, $timesheet);
}
$manager->persist($timesheet);
}
@@ -279,7 +279,7 @@ final class TimesheetFixtures extends Fixture
{
if (true === $this->useTags) {
$tagObject = new Tag();
$tagObject->setName($this->tags[($cnt % count($this->tags))]);
$tagObject->setName($this->tags[($cnt % \count($this->tags))]);
return [$tagObject];
}
@@ -355,7 +355,7 @@ final class TimesheetFixtures extends Fixture
->setRate($rate)
->setBegin($start);
if (count($tagArray) > 0) {
if (\count($tagArray) > 0) {
foreach ($tagArray as $item) {
$entry->addTag($item);
}