mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-25 11:18:51 +02: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
|
@ -42,7 +42,12 @@ class StructuralElementFromNameDenormalizer implements DenormalizerInterface
|
|||
return is_string($data) && is_subclass_of($type, AbstractStructuralDBElement::class);
|
||||
}
|
||||
|
||||
public function denormalize($data, string $type, string $format = null, array $context = []): ?AbstractStructuralDBElement
|
||||
/**
|
||||
* @template T
|
||||
* @phpstan-param class-string<T> $type
|
||||
* @phpstan-return T|null
|
||||
*/
|
||||
public function denormalize($data, string $type, string $format = null, array $context = []): AbstractStructuralDBElement|null
|
||||
{
|
||||
//Retrieve the repository for the given type
|
||||
/** @var StructuralDBElementRepository $repo */
|
||||
|
@ -69,7 +74,10 @@ class StructuralElementFromNameDenormalizer implements DenormalizerInterface
|
|||
return end($elements);
|
||||
}
|
||||
|
||||
public function getSupportedTypes(?string $format)
|
||||
/**
|
||||
* @return bool[]
|
||||
*/
|
||||
public function getSupportedTypes(?string $format): array
|
||||
{
|
||||
//Cachable value Must be false, because we do an is_string check on data in supportsDenormalization
|
||||
return [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue