Skip to content

Commit

Permalink
Fix GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
SerafimArts committed Aug 1, 2024
1 parent 2f9d7e4 commit c26c573
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 13 deletions.
7 changes: 3 additions & 4 deletions src/Executor.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ private function each(iterable $nodes): iterable
* Recursively traverse array (usually of nodes).
*
* @param array<array-key, object> $nodes Array to traverse
*
* @return array<array-key, object> Result of traversal. May be original
* array or changed one.
*/
Expand Down Expand Up @@ -229,7 +230,6 @@ protected function traverseArray(array $nodes): array
$error = \sprintf($error, \get_class($visitor), \gettype($visitor));

throw new BadMethodException($error, static::ERROR_CODE_ARRAY_ENTERING);

default:
$error = self::ERROR_ENTER_RETURN_TYPE;
$error = \sprintf($error, \get_class($visitor), \gettype($visitor));
Expand Down Expand Up @@ -297,7 +297,8 @@ protected function traverseArray(array $nodes): array
/**
* Recursively traverse a node.
*
* @param NodeInterface $node NodeInterface to traverse.
* @param NodeInterface $node nodeInterface to traverse
*
* @return NodeInterface Result of traversal (may be original node or new one)
*/
protected function traverseNode(NodeInterface $node): NodeInterface
Expand Down Expand Up @@ -375,7 +376,6 @@ protected function traverseNode(NodeInterface $node): NodeInterface
$error = \sprintf($error, \get_class($visitor));

throw new BadReturnTypeException($error, static::ERROR_CODE_NODE_LEAVING);

default:
$error = self::ERROR_LEAVE_RETURN_TYPE;
$error = \sprintf($error, \get_class($visitor), \gettype($return));
Expand All @@ -396,7 +396,6 @@ protected function traverseNode(NodeInterface $node): NodeInterface

/**
* @param string|int $key
* @param mixed $value
*/
private function updateNodeValue(NodeInterface $node, $key, $value): void
{
Expand Down
2 changes: 1 addition & 1 deletion src/ExecutorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface ExecutorInterface
/**
* Traverses an array of nodes using the registered visitors.
*
* @param iterable<array-key, object> $nodes List of nodes.
* @param iterable<array-key, object> $nodes list of nodes
*
* @return iterable<array-key, object> Traversed list of nodes
*/
Expand Down
2 changes: 0 additions & 2 deletions src/Traverser.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@

namespace Phplrt\Visitor;

use Phplrt\Contracts\Ast\NodeInterface;

class Traverser implements TraverserInterface
{
/**
Expand Down
3 changes: 1 addition & 2 deletions src/TraverserInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

namespace Phplrt\Visitor;

use Phplrt\Contracts\Ast\NodeInterface;

/**
* The TraverserInterface allows to traverse groups of
* nodes using visitor sets.
Expand Down Expand Up @@ -75,6 +73,7 @@ public function without(VisitorInterface $visitor): self;
* registered visitors.
*
* @param iterable<array-key, object> $nodes
*
* @return iterable<array-key, object>
*/
public function traverse(iterable $nodes): iterable;
Expand Down
6 changes: 2 additions & 4 deletions src/VisitorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,26 @@ interface VisitorInterface
* Called once before traversal.
*
* @param iterable|NodeInterface[]|NodeInterface $nodes
*
* @return iterable|NodeInterface[]|NodeInterface|null
*/
public function before(iterable $nodes): ?iterable;

/**
* Called when entering a node.
*
* @return mixed
*/
public function enter(NodeInterface $node);

/**
* Called when leaving a node.
*
* @return mixed
*/
public function leave(NodeInterface $node);

/**
* Called once after traversal.
*
* @param iterable|NodeInterface[]|NodeInterface $nodes
*
* @return iterable|NodeInterface[]|NodeInterface|null
*/
public function after(iterable $nodes): ?iterable;
Expand Down

0 comments on commit c26c573

Please sign in to comment.