apply more cs rules for php-cs

This commit is contained in:
2023-10-17 13:27:03 +02:00
parent 0b0cbed9db
commit bc2041cbdd
1485 changed files with 8169 additions and 9620 deletions

View File

@@ -23,7 +23,7 @@ class PersonMoveCenterHistoryHandler implements PersonMoveSqlHandlerInterface
public function supports(string $className, string $field): bool
{
return $className === Person\PersonCenterHistory::class;
return Person\PersonCenterHistory::class === $className;
}
public function getSqls(string $className, string $field, Person $from, Person $to): array
@@ -37,7 +37,7 @@ class PersonMoveCenterHistoryHandler implements PersonMoveSqlHandlerInterface
$centerHistoriesA = $this->centerHistoryRepository->findBy(['person' => $from]);
foreach ($centerHistoriesA as $ch) {
if ($oldestDateA === null || ($ch->getStartDate() < $oldestDateA)) {
if (null === $oldestDateA || ($ch->getStartDate() < $oldestDateA)) {
$oldestDateA = $ch->getStartDate();
$oldestCenterHistoryA = $ch;
}
@@ -45,7 +45,7 @@ class PersonMoveCenterHistoryHandler implements PersonMoveSqlHandlerInterface
$centerHistoriesB = $this->centerHistoryRepository->findBy(['person' => $to]);
foreach ($centerHistoriesB as $ch) {
if ($oldestDateB === null || ($ch->getStartDate() < $oldestDateB)) {
if (null === $oldestDateB || ($ch->getStartDate() < $oldestDateB)) {
$oldestDateB = $ch->getStartDate();
$oldestCenterHistoryB = $ch;
}
@@ -58,7 +58,6 @@ class PersonMoveCenterHistoryHandler implements PersonMoveSqlHandlerInterface
$sqlStatements = [$sqlDelete];
if ((null !== $oldestDateA && null !== $oldestDateB) && $oldestDateA <= $oldestDateB) {
$sqlInsert = sprintf(<<<'SQL'
UPDATE chill_person_person_center_history SET startDate = '%s' WHERE id = %d;
SQL, $oldestDateA->format('Y-m-d'), $oldestCenterHistoryB->getId());
@@ -67,7 +66,5 @@ class PersonMoveCenterHistoryHandler implements PersonMoveSqlHandlerInterface
}
return $sqlStatements;
}
}