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

@@ -22,7 +22,6 @@ use Chill\PersonBundle\Entity\Person;
use Chill\PersonBundle\Entity\PersonAltName;
use Chill\PersonBundle\Repository\Relationships\RelationshipRepository;
use Chill\PersonBundle\Templating\Entity\PersonRenderInterface;
use DateTimeInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\DataFixtures\Exception\CircularReferenceException;
use libphonenumber\PhoneNumber;
@@ -33,12 +32,6 @@ use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
use Symfony\Contracts\Translation\TranslatorInterface;
use function array_key_exists;
use function array_map;
use function implode;
use function in_array;
use function is_string;
class PersonDocGenNormalizer implements
ContextAwareNormalizerInterface,
NormalizerAwareInterface
@@ -63,7 +56,7 @@ class PersonDocGenNormalizer implements
/** @var Person $person */
$dateContext = $context;
$dateContext['docgen:expects'] = DateTimeInterface::class;
$dateContext['docgen:expects'] = \DateTimeInterface::class;
$addressContext = array_merge($context, ['docgen:expects' => Address::class]);
$phonenumberContext = array_merge($context, ['docgen:expects' => PhoneNumber::class]);
$centerContext = array_merge($context, ['docgen:expects' => Center::class]);
@@ -90,9 +83,9 @@ class PersonDocGenNormalizer implements
'civility' => $this->normalizer->normalize($person->getCivility(), $format, array_merge($context, ['docgen:expects' => Civility::class])),
'firstName' => $person->getFirstName(),
'lastName' => $person->getLastName(),
'altNames' => implode(
'altNames' => \implode(
', ',
array_map(
\array_map(
static fn (PersonAltName $altName) => $altName->getLabel(),
$person->getAltNames()->toArray()
)
@@ -177,7 +170,7 @@ class PersonDocGenNormalizer implements
$key = spl_object_hash($person);
}
if (!array_key_exists(self::CIRCULAR_KEY, $context)) {
if (!\array_key_exists(self::CIRCULAR_KEY, $context)) {
$context[self::CIRCULAR_KEY] = [$key];
return $context;
@@ -204,11 +197,11 @@ class PersonDocGenNormalizer implements
{
$groups = $context[AbstractNormalizer::GROUPS] ?? [];
if (is_string($groups)) {
if (\is_string($groups)) {
$groups = [$groups];
}
return in_array($group, $groups, true);
return \in_array($group, $groups, true);
}
private function normalizeNullValue(string $format, array $context)
@@ -219,10 +212,10 @@ class PersonDocGenNormalizer implements
'id', 'firstName', 'lastName', 'age', 'altNames', 'text',
'center' => Center::class,
'civility' => Civility::class,
'birthdate' => DateTimeInterface::class,
'deathdate' => DateTimeInterface::class,
'birthdate' => \DateTimeInterface::class,
'deathdate' => \DateTimeInterface::class,
'gender', 'maritalStatus',
'maritalStatusDate' => DateTimeInterface::class,
'maritalStatusDate' => \DateTimeInterface::class,
'maritalStatusComment',
'email', 'firstPhoneNumber', 'fixPhoneNumber', 'mobilePhoneNumber', 'nationality',
'placeOfBirth', 'memo', 'numberOfChildren',