mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-08 12:09:30 +00:00
Improved typing and phpdoc type annotations
This commit is contained in:
parent
3817ba774d
commit
b7c8ca2a48
39 changed files with 189 additions and 129 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue