mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -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
|
||||
|
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -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];
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -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];
|
||||
|
Reference in New Issue
Block a user