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,12 +19,8 @@ use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation;
use Chill\PersonBundle\Entity\Person;
use Chill\PersonBundle\Security\Authorization\PersonVoter;
use Doctrine\ORM\EntityManager;
use LogicException;
use Symfony\Component\Security\Core\Security;
use function implode;
use function in_array;
/**
* Provide method to build timeline for accompanying periods.
*
@@ -43,7 +39,7 @@ abstract class AbstractTimelineAccompanyingPeriod implements TimelineProviderInt
->getRepository('ChillPersonBundle:AccompanyingPeriod')
->findBy(['id' => $ids]);
//set results in an associative array with id as indexes
// set results in an associative array with id as indexes
$results = [];
foreach ($periods as $period) {
@@ -58,15 +54,14 @@ abstract class AbstractTimelineAccompanyingPeriod implements TimelineProviderInt
*
* @param string $context
*
* @throws LogicException
*
* @return array
*
* @throws \LogicException
*/
protected function basicFetchQuery($context, array $args)
{
if (false === in_array($context, self::SUPPORTED_CONTEXTS, true)) {
throw new LogicException('TimelineAccompanyingPeriod is not able '
. 'to render context ' . $context);
if (false === \in_array($context, self::SUPPORTED_CONTEXTS, true)) {
throw new \LogicException('TimelineAccompanyingPeriod is not able to render context '.$context);
}
$metadata = $this->em
@@ -98,7 +93,7 @@ abstract class AbstractTimelineAccompanyingPeriod implements TimelineProviderInt
$questionMarks[] = '?';
$params[] = $c->getId();
}
$query .= implode(', ', $questionMarks) . ')';
$query .= \implode(', ', $questionMarks).')';
return [$query, $params];
}
@@ -107,7 +102,7 @@ abstract class AbstractTimelineAccompanyingPeriod implements TimelineProviderInt
return ["{$participation->getTableName()}.{$join['name']} = ?", [$args['person']->getId()]];
}
throw new LogicException("this context is not supported: {$context}");
throw new \LogicException("this context is not supported: {$context}");
}
/**
@@ -115,6 +110,7 @@ abstract class AbstractTimelineAccompanyingPeriod implements TimelineProviderInt
*
* @param string $template the template for rendering
* @param string $context
*
* @return array
*/
protected function getBasicEntityTemplate($template, mixed $entity, $context, array $args)
@@ -134,18 +130,18 @@ abstract class AbstractTimelineAccompanyingPeriod implements TimelineProviderInt
$joinPerson = $participation->getAssociationMapping('person')['joinColumns'][0];
if ('person' === $context) {
return "{$period->getTableName()} " .
"JOIN {$participation->getTableName()} " .
"ON {$participation->getTableName()}.{$join['name']} = " .
return "{$period->getTableName()} ".
"JOIN {$participation->getTableName()} ".
"ON {$participation->getTableName()}.{$join['name']} = ".
"{$period->getTableName()}.{$join['referencedColumnName']}";
}
return "{$period->getTableName()} " .
"JOIN {$participation->getTableName()} " .
"ON {$participation->getTableName()}.{$join['name']} = " .
"{$period->getTableName()}.{$join['referencedColumnName']} " .
"JOIN {$person->getTableName()} " .
"ON {$participation->getTableName()}.{$joinPerson['name']} = " .
return "{$period->getTableName()} ".
"JOIN {$participation->getTableName()} ".
"ON {$participation->getTableName()}.{$join['name']} = ".
"{$period->getTableName()}.{$join['referencedColumnName']} ".
"JOIN {$person->getTableName()} ".
"ON {$participation->getTableName()}.{$joinPerson['name']} = ".
"{$person->getTableName()}.{$joinPerson['referencedColumnName']}";
}
}