sa: Fix all issues related to PHP versions and static-analysis.

This commit is contained in:
Pol Dellaiera
2021-12-21 11:58:58 +01:00
parent b3823161af
commit b743475761
25 changed files with 79 additions and 81 deletions

View File

@@ -94,7 +94,7 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf
/**
* @param AccompanyingPeriod|null $period
*/
public function normalize($period, ?string $format = null, array $context = [])
public function normalize($period, $format = null, array $context = [])
{
if ($period instanceof AccompanyingPeriod) {
$scopes = $this->scopeResolverDispatcher->isConcerned($period) ? $this->scopeResolverDispatcher->resolveScope($period) : [];
@@ -147,7 +147,9 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf
'hasRequestor' => $period->getRequestor() !== null,
'requestorKind' => $period->getRequestorKind(),
];
} elseif (null === $period) {
}
if (null === $period) {
return array_merge(
(new NormalizeNullValueHelper($this->normalizer, 'type', 'accompanying_period'))
->normalize(self::PERIOD_NULL, $format, $context),
@@ -163,10 +165,10 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf
);
}
throw new InvalidArgumentException('this neither an accompanying period or null');
throw new InvalidArgumentException('This neither an accompanying period or null.');
}
public function supportsNormalization($data, ?string $format = null, array $context = []): bool
public function supportsNormalization($data, $format = null, array $context = []): bool
{
if ('docgen' !== $format) {
return false;