Skip to content

Commit

Permalink
TASK: Make requireNodeType private
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Apr 3, 2024
1 parent ec8f4ef commit e224d4a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -78,8 +78,8 @@ protected function createEventsForMissingTetheredNode(

if (count($childNodeAggregates) === 0) {
// there is no tethered child node aggregate already; let's create it!
$nodeType = $this->nodeTypeManager->requireNodeType($parentNodeAggregate->nodeTypeName);
if ($nodeType->isOfType(NodeTypeName::ROOT_NODE_TYPE_NAME)) {
$nodeType = $this->nodeTypeManager->getNodeType($parentNodeAggregate->nodeTypeName);
if ($nodeType?->isOfType(NodeTypeName::ROOT_NODE_TYPE_NAME)) {
$events = [];
$tetheredNodeAggregateId = $tetheredNodeAggregateId ?: NodeAggregateId::create();
// we create in one origin DSP and vary in the others
Expand Down
Expand Up @@ -384,9 +384,9 @@ private function evaluateSuperTypeConfiguration(
}

/**
* @internal helper to throw if the NodeType doesn't exit
* Helper to throw if the NodeType doesn't exit
*/
public function requireNodeType(string|NodeTypeName $nodeTypeName): NodeType
private function requireNodeType(string|NodeTypeName $nodeTypeName): NodeType
{
return $this->getNodeType($nodeTypeName) ?? throw new NodeTypeNotFoundException(
sprintf(
Expand Down

0 comments on commit e224d4a

Please sign in to comment.