mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-17 16:21:30 +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
|
@ -68,7 +68,12 @@ class PartNormalizer implements NormalizerInterface, DenormalizerInterface
|
|||
return $data instanceof Part;
|
||||
}
|
||||
|
||||
public function normalize($object, string $format = null, array $context = []): array
|
||||
/**
|
||||
* @return (float|mixed)[]|\ArrayObject|null|scalar
|
||||
*
|
||||
* @psalm-return \ArrayObject|array{total_instock: float|mixed,...}|null|scalar
|
||||
*/
|
||||
public function normalize($object, string $format = null, array $context = [])
|
||||
{
|
||||
if (!$object instanceof Part) {
|
||||
throw new \InvalidArgumentException('This normalizer only supports Part objects!');
|
||||
|
@ -178,7 +183,10 @@ class PartNormalizer implements NormalizerInterface, DenormalizerInterface
|
|||
return $object;
|
||||
}
|
||||
|
||||
public function getSupportedTypes(?string $format)
|
||||
/**
|
||||
* @return bool[]
|
||||
*/
|
||||
public function getSupportedTypes(?string $format): array
|
||||
{
|
||||
//Must be false, because we rely on is_array($data) in supportsDenormalization()
|
||||
return [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue