From 5f29ee90529ad0f84c5a6fdf4358e4ac5356c160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sat, 15 Apr 2023 21:18:11 +0200 Subject: [PATCH] Fixed some deprecation messages --- src/DataTables/Column/RowClassColumn.php | 3 +++ src/DataTables/Column/SIUnitNumberColumn.php | 2 +- src/DataTables/Column/SelectColumn.php | 3 +++ src/Entity/UserSystem/PermissionData.php | 4 ++-- src/Serializer/PartNormalizer.php | 4 ++-- src/Serializer/StructuralElementDenormalizer.php | 2 +- src/Serializer/StructuralElementFromNameDenormalizer.php | 2 +- src/Serializer/StructuralElementNormalizer.php | 2 +- 8 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/DataTables/Column/RowClassColumn.php b/src/DataTables/Column/RowClassColumn.php index d25ffc20..c583cf2f 100644 --- a/src/DataTables/Column/RowClassColumn.php +++ b/src/DataTables/Column/RowClassColumn.php @@ -48,6 +48,9 @@ class RowClassColumn extends AbstractColumn parent::initialize('$$rowClass', $index, $options, $dataTable); // TODO: Change the autogenerated stub } + /** + * @return mixed + */ public function normalize($value) { return $value; diff --git a/src/DataTables/Column/SIUnitNumberColumn.php b/src/DataTables/Column/SIUnitNumberColumn.php index 42a0649a..fa09e227 100644 --- a/src/DataTables/Column/SIUnitNumberColumn.php +++ b/src/DataTables/Column/SIUnitNumberColumn.php @@ -43,7 +43,7 @@ class SIUnitNumberColumn extends AbstractColumn return $this; } - public function normalize($value) + public function normalize($value): string { //Ignore null values if ($value === null) { diff --git a/src/DataTables/Column/SelectColumn.php b/src/DataTables/Column/SelectColumn.php index 6a057be3..c26e916c 100644 --- a/src/DataTables/Column/SelectColumn.php +++ b/src/DataTables/Column/SelectColumn.php @@ -43,6 +43,9 @@ class SelectColumn extends AbstractColumn return $this; } + /** + * @return mixed + */ public function normalize($value) { return $value; diff --git a/src/Entity/UserSystem/PermissionData.php b/src/Entity/UserSystem/PermissionData.php index 121e7f5f..0de8dd55 100644 --- a/src/Entity/UserSystem/PermissionData.php +++ b/src/Entity/UserSystem/PermissionData.php @@ -203,9 +203,9 @@ final class PermissionData implements \JsonSerializable /** * Returns an JSON encodable representation of this object. - * @return array|mixed + * @return array */ - public function jsonSerialize() + public function jsonSerialize(): array { $ret = []; diff --git a/src/Serializer/PartNormalizer.php b/src/Serializer/PartNormalizer.php index ef844acf..ce910d8c 100644 --- a/src/Serializer/PartNormalizer.php +++ b/src/Serializer/PartNormalizer.php @@ -58,7 +58,7 @@ class PartNormalizer implements NormalizerInterface, DenormalizerInterface, Cach return $data instanceof Part; } - public function normalize($object, string $format = null, array $context = []) + public function normalize($object, string $format = null, array $context = []): array { if (!$object instanceof Part) { throw new \InvalidArgumentException('This normalizer only supports Part objects!'); @@ -94,7 +94,7 @@ class PartNormalizer implements NormalizerInterface, DenormalizerInterface, Cach return $data; } - public function denormalize($data, string $type, string $format = null, array $context = []) + public function denormalize($data, string $type, string $format = null, array $context = []): ?Part { $this->normalizeKeys($data); diff --git a/src/Serializer/StructuralElementDenormalizer.php b/src/Serializer/StructuralElementDenormalizer.php index 89141f02..5b1396c1 100644 --- a/src/Serializer/StructuralElementDenormalizer.php +++ b/src/Serializer/StructuralElementDenormalizer.php @@ -51,7 +51,7 @@ class StructuralElementDenormalizer implements ContextAwareDenormalizerInterface && in_array('import', $context['groups'] ?? []); } - public function denormalize($data, string $type, string $format = null, array $context = []) + public function denormalize($data, string $type, string $format = null, array $context = []): ?AbstractStructuralDBElement { /** @var AbstractStructuralDBElement $deserialized_entity */ $deserialized_entity = $this->normalizer->denormalize($data, $type, $format, $context); diff --git a/src/Serializer/StructuralElementFromNameDenormalizer.php b/src/Serializer/StructuralElementFromNameDenormalizer.php index adeb50cc..9aeab102 100644 --- a/src/Serializer/StructuralElementFromNameDenormalizer.php +++ b/src/Serializer/StructuralElementFromNameDenormalizer.php @@ -42,7 +42,7 @@ class StructuralElementFromNameDenormalizer implements DenormalizerInterface, Ca return is_string($data) && is_subclass_of($type, AbstractStructuralDBElement::class); } - public function denormalize($data, string $type, string $format = null, array $context = []) + public function denormalize($data, string $type, string $format = null, array $context = []): ?AbstractStructuralDBElement { //Retrieve the repository for the given type /** @var StructuralDBElementRepository $repo */ diff --git a/src/Serializer/StructuralElementNormalizer.php b/src/Serializer/StructuralElementNormalizer.php index c412fabd..07007ae6 100644 --- a/src/Serializer/StructuralElementNormalizer.php +++ b/src/Serializer/StructuralElementNormalizer.php @@ -41,7 +41,7 @@ class StructuralElementNormalizer implements NormalizerInterface, CacheableSuppo return $data instanceof AbstractStructuralDBElement; } - public function normalize($object, string $format = null, array $context = []) + public function normalize($object, string $format = null, array $context = []): array { if (!$object instanceof AbstractStructuralDBElement) { throw new \InvalidArgumentException('This normalizer only supports AbstractStructural objects!');