Improved typing and phpdoc type annotations

This commit is contained in:
Jan Böhmer 2023-06-18 15:37:42 +02:00
parent 3817ba774d
commit b7c8ca2a48
39 changed files with 189 additions and 129 deletions

View file

@ -46,7 +46,10 @@ class StructuralElementNormalizer implements NormalizerInterface
return $data instanceof AbstractStructuralDBElement;
}
public function normalize($object, string $format = null, array $context = []): array
/**
* @return array<string, mixed>
*/
public function normalize($object, string $format = null, array $context = [])
{
if (!$object instanceof AbstractStructuralDBElement) {
throw new \InvalidArgumentException('This normalizer only supports AbstractStructural objects!');
@ -64,7 +67,10 @@ class StructuralElementNormalizer implements NormalizerInterface
return $data;
}
public function getSupportedTypes(?string $format)
/**
* @return bool[]
*/
public function getSupportedTypes(?string $format): array
{
return [
AbstractStructuralDBElement::class => true,