Skip to content

Commit

Permalink
Applied review remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
barw4 committed Nov 26, 2024
1 parent 9f48a33 commit 852d0b1
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
6 changes: 0 additions & 6 deletions src/contracts/Output/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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']);
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/Output/ValueObjectVisitorResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

final class ValueObjectVisitorResolver implements ValueObjectVisitorResolverInterface
{
/** @var array<class-string, ValueObjectVisitor> */
/** @var array<class-string, \Ibexa\Contracts\Rest\Output\ValueObjectVisitor> */
private array $visitors;

/**
Expand Down
2 changes: 0 additions & 2 deletions src/contracts/Output/VisitorAdapterNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ private function visitValueObject(

$generator->reset();
$generator->startDocument($object);

$valueObjectVisitor->visit($visitor, $generator, $object);

$generator->endDocument($object);

$data = $generator->getData();
Expand Down
4 changes: 3 additions & 1 deletion src/lib/Output/Generator/Data/ArrayList.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/lib/Output/Generator/Json/ArrayObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/lib/Output/Generator/Json/JsonObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions src/lib/Output/Normalizer/ArrayObjectNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions src/lib/Output/Normalizer/JsonObjectNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 852d0b1

Please sign in to comment.