Skip to content

Commit

Permalink
misc!: remove node visitor feature
Browse files Browse the repository at this point in the history
This feature was a relic of the first release of the library. It had
strong design issues and was going to become a huge blocker for upcoming
features.

Although it was never documented, it may have been used in applications;
there will be no replacement for this feature. If this becomes an issue
for existing applications, an issue can be created in the repository to
discuss other possible solutions.
  • Loading branch information
romm committed Jul 10, 2022
1 parent 8d7c369 commit 63c87a2
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 98 deletions.
2 changes: 0 additions & 2 deletions src/Library/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
use CuyZ\Valinor\Mapper\Tree\Builder\StrictNodeBuilder;
use CuyZ\Valinor\Mapper\Tree\Builder\UnionNodeBuilder;
use CuyZ\Valinor\Mapper\Tree\Builder\ValueAlteringNodeBuilder;
use CuyZ\Valinor\Mapper\Tree\Builder\VisitorNodeBuilder;
use CuyZ\Valinor\Mapper\Tree\Visitor\AttributeShellVisitor;
use CuyZ\Valinor\Mapper\Tree\Visitor\ShellVisitor;
use CuyZ\Valinor\Mapper\TreeMapper;
Expand Down Expand Up @@ -125,7 +124,6 @@ public function __construct(Settings $settings)

$builder = new CasterProxyNodeBuilder($builder);
$builder = new IterableNodeBuilder($builder);
$builder = new VisitorNodeBuilder($builder, $settings->nodeVisitors);
$builder = new ValueAlteringNodeBuilder(
$builder,
new FunctionsContainer(
Expand Down
4 changes: 0 additions & 4 deletions src/Library/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace CuyZ\Valinor\Library;

use CuyZ\Valinor\Mapper\Tree\Message\ErrorMessage;
use CuyZ\Valinor\Mapper\Tree\Node;
use DateTimeImmutable;
use DateTimeInterface;
use Psr\SimpleCache\CacheInterface;
Expand All @@ -26,9 +25,6 @@ final class Settings
/** @var list<callable> */
public array $valueModifier = [];

/** @var array<callable(Node): void> */
public array $nodeVisitors = [];

/** @var CacheInterface<mixed> */
public CacheInterface $cache;

Expand Down
37 changes: 0 additions & 37 deletions src/Mapper/Tree/Builder/VisitorNodeBuilder.php

This file was deleted.

11 changes: 0 additions & 11 deletions src/MapperBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use CuyZ\Valinor\Library\Container;
use CuyZ\Valinor\Library\Settings;
use CuyZ\Valinor\Mapper\Tree\Message\ErrorMessage;
use CuyZ\Valinor\Mapper\Tree\Node;
use CuyZ\Valinor\Mapper\TreeMapper;
use Psr\SimpleCache\CacheInterface;
use Throwable;
Expand Down Expand Up @@ -225,16 +224,6 @@ public function alter(callable $callback): self
return $clone;
}

/**
* @param callable(Node): void $callback
*/
public function visit(callable $callback): self
{
$this->settings->nodeVisitors[] = $callback;

return $this;
}

/**
* Enables flexible mode for the mapper:
*
Expand Down
44 changes: 0 additions & 44 deletions tests/Integration/Mapping/VisitorMappingTest.php

This file was deleted.

0 comments on commit 63c87a2

Please sign in to comment.