cs: Fix code-style (using PHPCSFixer and PHPCS).

This commit is contained in:
Pol Dellaiera
2021-12-21 10:59:23 +01:00
parent b7360955f7
commit 8401ce2656
280 changed files with 742 additions and 319 deletions

View File

@@ -42,8 +42,10 @@ use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Symfony\Component\Validator\GroupSequenceProviderInterface;
use UnexpectedValueException;
use function count;
use function in_array;
use const SORT_REGULAR;
/**
@@ -533,8 +535,10 @@ class AccompanyingPeriod implements
public function getCenters(): ?iterable
{
foreach ($this->getPersons() as $person) {
if (!in_array($person->getCenter(), $centers ?? [], true)
&& null !== $person->getCenter()) {
if (
!in_array($person->getCenter(), $centers ?? [], true)
&& null !== $person->getCenter()
) {
$centers[] = $person->getCenter();
}
}

View File

@@ -410,8 +410,10 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
*/
public function setAccompanyingPeriod(?AccompanyingPeriod $accompanyingPeriod): self
{
if ($this->accompanyingPeriod instanceof AccompanyingPeriod
&& $accompanyingPeriod !== $this->accompanyingPeriod) {
if (
$this->accompanyingPeriod instanceof AccompanyingPeriod
&& $accompanyingPeriod !== $this->accompanyingPeriod
) {
throw new LogicException('A work cannot change accompanyingPeriod');
}

View File

@@ -268,7 +268,8 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU
if (
$accompanyingPeriodWork instanceof AccompanyingPeriodWork
&& $this->accompanyingPeriodWork instanceof AccompanyingPeriodWork
&& $this->accompanyingPeriodWork->getId() !== $accompanyingPeriodWork->getId()) {
&& $this->accompanyingPeriodWork->getId() !== $accompanyingPeriodWork->getId()
) {
throw new RuntimeException('Changing the ' .
'accompanyingPeriodWork is not allowed');
}

View File

@@ -144,8 +144,10 @@ class AccompanyingPeriodWorkEvaluationDocument implements \Chill\MainBundle\Doct
{
// if an evaluation is already associated, we cannot change the association (removing the association,
// by setting a null value, is allowed.
if ($this->accompanyingPeriodWorkEvaluation instanceof AccompanyingPeriodWorkEvaluation
&& $accompanyingPeriodWorkEvaluation instanceof AccompanyingPeriodWorkEvaluation) {
if (
$this->accompanyingPeriodWorkEvaluation instanceof AccompanyingPeriodWorkEvaluation
&& $accompanyingPeriodWorkEvaluation instanceof AccompanyingPeriodWorkEvaluation
) {
if ($this->accompanyingPeriodWorkEvaluation !== $accompanyingPeriodWorkEvaluation) {
throw new RuntimeException('It is not allowed to change the evaluation for a document');
}

View File

@@ -117,7 +117,8 @@ class AccompanyingPeriodWorkGoal
public function setAccompanyingPeriodWork(?AccompanyingPeriodWork $accompanyingPeriodWork): self
{
if ($this->accompanyingPeriodWork instanceof AccompanyingPeriodWork
if (
$this->accompanyingPeriodWork instanceof AccompanyingPeriodWork
&& $accompanyingPeriodWork !== $this->accompanyingPeriodWork
&& null !== $accompanyingPeriodWork
) {

View File

@@ -24,6 +24,7 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use function count;
/**
@@ -254,7 +255,9 @@ class Household
public function getCurrentPersons(?DateTimeImmutable $now = null): Collection
{
return $this->getCurrentMembers($now)
->map(static function (HouseholdMember $m) { return $m->getPerson(); });
->map(static function (HouseholdMember $m) {
return $m->getPerson();
});
}
public function getId(): ?int