throw new \InvalidArgumentException("Only scalars allowed as scope identifiers");
35
}
36
8
array_push(self::$scope, $scope);
37
8
list($call) = debug_backtrace(0);
38
8
array_push(self::$scopeChange, $call);
39
8
}
40
41
42
/**
43
* @param string $scope
44
* @throws ScopeException
45
* @return void
46
*/
47
8
public static function exitScope($scope)
48
{
49
8
$current = array_pop(self::$scope);
50
8
$call = array_pop(self::$scopeChange);
51
8
if ($scope !== $current) {
52
throw new \LogicException("The current scope '$current' was not closed properly, while trying to close '$scope', which was opened at {$call['file']}@{$call['line']}");