Skip to content

Commit

Permalink
Fix: Wrap createDataFromService method, because the parameter do not …
Browse files Browse the repository at this point in the history
…match the connected signal parameter
  • Loading branch information
jonnitto committed Jul 8, 2024
1 parent 7706cdd commit d903a8f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Classes/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function boot(Bootstrap $bootstrap): void
Node::class,
'nodeAdded',
MetadataService::class,
'createDataFromService'
'onNodeAdded'
);
$dispatcher->connect(
Node::class,
Expand Down
12 changes: 12 additions & 0 deletions Classes/Service/MetadataService.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ class MetadataService
*/
protected $defaultReturn = ['node' => null];

/**
* Wrapper method to handle signals from Node::nodeAdded
*
* @param NodeInterface $node
* @return array|null[]
* @throws IllegalObjectTypeException
* @throws NodeException
*/
public function onNodeAdded(NodeInterface $node)
{
return $this->createDataFromService($node);
}

/**
* Create data
Expand Down

0 comments on commit d903a8f

Please sign in to comment.