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

@@ -19,7 +19,7 @@ class PersonMoveAccompanyingPeriodParticipationHandler implements PersonMoveSqlH
{
public function supports(string $className, string $field): bool
{
return $className === AccompanyingPeriodParticipation::class;
return AccompanyingPeriodParticipation::class === $className;
}
public function getSqls(string $className, string $field, Person $from, Person $to): array

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;
}
}

View File

@@ -19,7 +19,7 @@ class PersonMoveHouseholdHandler implements PersonMoveSqlHandlerInterface
{
public function supports(string $className, string $field): bool
{
return $className === HouseholdMember::class;
return HouseholdMember::class === $className;
}
public function getSqls(string $className, string $field, Person $from, Person $to): array
@@ -43,5 +43,4 @@ class PersonMoveHouseholdHandler implements PersonMoveSqlHandlerInterface
return [$sqlInsert, $deleteSql];
}
}

View File

@@ -19,7 +19,7 @@ class PersonMoveRelationHandler implements PersonMoveSqlHandlerInterface
{
public function supports(string $className, string $field): bool
{
return $className === Relationship::class;
return Relationship::class === $className;
}
public function getSqls(string $className, string $field, Person $from, Person $to): array
@@ -38,8 +38,8 @@ class PersonMoveRelationHandler implements PersonMoveSqlHandlerInterface
SQL, $from->getId(), $from->getId(), $to->getId(), $from->getId(), $from->getId(), $to->getId());
$deleteSql = [
sprintf("DELETE FROM chill_person_relationships WHERE fromperson_id = %d", $from->getId()),
sprintf("DELETE FROM chill_person_relationships WHERE toperson_id = %d", $from->getId())
sprintf('DELETE FROM chill_person_relationships WHERE fromperson_id = %d', $from->getId()),
sprintf('DELETE FROM chill_person_relationships WHERE toperson_id = %d', $from->getId()),
];
return [$insertSql, ...$deleteSql];