for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Spiral\Core\Exception\Scope;
final class ScopeContainerLeakedException extends ScopeException
{
/**
* @param array<int<0, max>, string|null> $parents
array<int<0, max>, string|null>
2
*/
public function __construct(
?string $scope,
array $parents,
) {
$scopes = \implode('->', \array_map(
static fn (?string $scope): string => $scope === null ? 'null' : "\"$scope\"",
[...\array_reverse($parents), $scope],
));
parent::__construct(
$scope,
\sprintf('Scoped container has been leaked. Scope: %s.', $scopes),
);
}