Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions Neos.Neos/Classes/Fusion/Helper/CachingHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,14 @@ class CachingHelper implements ProtectedContextAwareInterface
* A cache entry with this tag will be flushed whenever one of the
* given nodes (for any variant) is updated.
*
* @param iterable<Node>|Node $nodes (A single Node or array or \Traversable of Nodes)
* @param iterable<Node>|Node|null $nodes (A single Node or array or \Traversable of Nodes or null)
* @return array<int,string>,
*/
public function nodeTag(iterable|Node $nodes): array
public function nodeTag(iterable|Node|null $nodes): array
{
if (!$nodes) {
return [];
}
if (!is_iterable($nodes)) {
$nodes = [$nodes];
} else {
Expand Down Expand Up @@ -143,11 +146,14 @@ public function nodeTypeTag(string|iterable $nodeTypes, Node $contextNode): arra
* (for any variant) that is a descendant (child on any level) of one of
* the given nodes is updated.
*
* @param iterable<Node>|Node $nodes (A single Node or array or \Traversable of Nodes)
* @param iterable<Node>|Node|null $nodes (A single Node or array or \Traversable of Nodes or null)
* @return array<int,string>
*/
public function descendantOfTag(iterable|Node $nodes): array
public function descendantOfTag(iterable|Node|null $nodes): array
{
if (!$nodes) {
return [];
}
if (!is_iterable($nodes)) {
$nodes = [$nodes];
} else {
Expand Down
6 changes: 4 additions & 2 deletions Neos.Neos/Tests/Unit/Fusion/Helper/CachingHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ public function nodeDataProvider()
'Node_7505d64a54e061b7acd54ccd58b49dc43500b635_ca511a55-c5c0-f7d7-8d71-8edeffc75306',
'Node_7505d64a54e061b7acd54ccd58b49dc43500b635_7005c7cf-4d19-ce36-0873-476b6cadb71a',
'Workspace_364cfc8e70b2baa23dbd14503d2bd00e063829e7',
]]
]],
[null, []],
];
}

Expand Down Expand Up @@ -224,7 +225,8 @@ public function descendantOfDataProvider()
'DescendantOf_7505d64a54e061b7acd54ccd58b49dc43500b635_ca511a55-c5c0-f7d7-8d71-8edeffc75306',
'DescendantOf_7505d64a54e061b7acd54ccd58b49dc43500b635_7005c7cf-4d19-ce36-0873-476b6cadb71a',
'Workspace_364cfc8e70b2baa23dbd14503d2bd00e063829e7',
]]
]],
[null, []],
];
}

Expand Down