return [];
} \
assert($node->expr->class instanceof Node\Name
);
$exceptionClass =
$node->expr->class->
toString();
if (\
in_array($exceptionClass, self::VALID_EXCEPTION_CLASSES, true
)) { return [];
} return [ RuleErrorBuilder::
message('Throwing new exceptions within classes are not allowed. Please use domain exception pattern. See https://github.com/shopware/platform/blob/v6.4.20.0/adr/2022-02-24-domain-exceptions.md'
)->
build(),
];
} /**
* @return list<RuleError>
*/
private function validateDomainExceptionClass(Node\Expr\StaticCall
$node, Scope
$scope): array
{ \
assert($node->class instanceof Node\Name
);
$exceptionClass =
$node->class->
toString();