diff --git a/src/bundle/DependencyInjection/Compiler/ValueObjectVisitorResolverPass.php b/src/bundle/DependencyInjection/Compiler/ValueObjectVisitorResolverPass.php index 387bd281..5dd8d0f0 100644 --- a/src/bundle/DependencyInjection/Compiler/ValueObjectVisitorResolverPass.php +++ b/src/bundle/DependencyInjection/Compiler/ValueObjectVisitorResolverPass.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ +declare(strict_types=1); namespace Ibexa\Bundle\Rest\DependencyInjection\Compiler; diff --git a/src/contracts/Output/Generator.php b/src/contracts/Output/Generator.php index 964572e2..fad34e10 100644 --- a/src/contracts/Output/Generator.php +++ b/src/contracts/Output/Generator.php @@ -140,9 +140,6 @@ public function startObjectElement(string $name, ?string $mediaTypeName = null): $this->attribute('media-type', $this->getMediaType($mediaTypeName)); } - /** - * End object element. - */ public function endObjectElement(string $name): void { $this->checkEndObjectElement($name); @@ -157,9 +154,6 @@ public function endObjectElement(string $name): void $this->json = $this->json->getParent(); } - /** - * Check start object element. - */ protected function checkStartObjectElement(mixed $data): void { $this->checkStart('objectElement', $data, ['document', 'objectElement', 'hashElement', 'list']); diff --git a/src/contracts/Output/ValueObjectVisitorResolver.php b/src/contracts/Output/ValueObjectVisitorResolver.php index d23fc68e..1093f04b 100644 --- a/src/contracts/Output/ValueObjectVisitorResolver.php +++ b/src/contracts/Output/ValueObjectVisitorResolver.php @@ -10,7 +10,7 @@ final class ValueObjectVisitorResolver implements ValueObjectVisitorResolverInterface { - /** @var array */ + /** @var array */ private array $visitors; /** diff --git a/src/contracts/Output/VisitorAdapterNormalizer.php b/src/contracts/Output/VisitorAdapterNormalizer.php index 90fc6957..c42a0ef8 100644 --- a/src/contracts/Output/VisitorAdapterNormalizer.php +++ b/src/contracts/Output/VisitorAdapterNormalizer.php @@ -104,9 +104,7 @@ private function visitValueObject( $generator->reset(); $generator->startDocument($object); - $valueObjectVisitor->visit($visitor, $generator, $object); - $generator->endDocument($object); $data = $generator->getData(); diff --git a/src/lib/Output/Generator/Data/ArrayList.php b/src/lib/Output/Generator/Data/ArrayList.php index 962f0ebd..4f62c73c 100644 --- a/src/lib/Output/Generator/Data/ArrayList.php +++ b/src/lib/Output/Generator/Data/ArrayList.php @@ -8,7 +8,9 @@ namespace Ibexa\Rest\Output\Generator\Data; -final class ArrayList extends \ArrayObject implements DataObjectInterface +use ArrayObject; + +final class ArrayList extends ArrayObject implements DataObjectInterface { private ?DataObjectInterface $parent; diff --git a/src/lib/Output/Generator/Json/ArrayObject.php b/src/lib/Output/Generator/Json/ArrayObject.php index 948024e0..23eaffa3 100644 --- a/src/lib/Output/Generator/Json/ArrayObject.php +++ b/src/lib/Output/Generator/Json/ArrayObject.php @@ -19,7 +19,7 @@ * parent object it is assigned to again. */ #[AllowDynamicProperties] -class ArrayObject extends NativeArrayObject implements DataObjectInterface +final class ArrayObject extends NativeArrayObject implements DataObjectInterface { /** * Reference to the parent node. diff --git a/src/lib/Output/Generator/Json/JsonObject.php b/src/lib/Output/Generator/Json/JsonObject.php index ff98cdb5..b53b65d6 100644 --- a/src/lib/Output/Generator/Json/JsonObject.php +++ b/src/lib/Output/Generator/Json/JsonObject.php @@ -18,12 +18,12 @@ * parent object it is assigned to again. */ #[AllowDynamicProperties] -class JsonObject implements DataObjectInterface +final class JsonObject implements DataObjectInterface { /** * Reference to the parent node. */ - protected ?DataObjectInterface $_ref_parent; + private ?DataObjectInterface $_ref_parent; /** * Construct from optional parent node. diff --git a/src/lib/Output/Normalizer/ArrayObjectNormalizer.php b/src/lib/Output/Normalizer/ArrayObjectNormalizer.php index fc6994b8..f5b778ca 100644 --- a/src/lib/Output/Normalizer/ArrayObjectNormalizer.php +++ b/src/lib/Output/Normalizer/ArrayObjectNormalizer.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ +declare(strict_types=1); namespace Ibexa\Rest\Output\Normalizer; diff --git a/src/lib/Output/Normalizer/JsonObjectNormalizer.php b/src/lib/Output/Normalizer/JsonObjectNormalizer.php index c703959d..4a00ae77 100644 --- a/src/lib/Output/Normalizer/JsonObjectNormalizer.php +++ b/src/lib/Output/Normalizer/JsonObjectNormalizer.php @@ -4,6 +4,7 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ +declare(strict_types=1); namespace Ibexa\Rest\Output\Normalizer;