19 declare(strict_types=1);
53 $this->
claim($this->repo->external(),
true);
60 $this->call_locations = [];
68 if (!$silent && in_array($context, $this->stack)) {
75 parent::push($context);
80 $called_classes = array_filter(
81 debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS),
82 function ($item) :
bool {
83 if (!isset($item[
'class'])) {
87 return (!in_array($item[
'class'], [CalledContexts::class, ContextCollection::class]));
92 function (&$item) :
void {
93 $item = ($item[
'class'] ??
'') .
":" . ($item[
'line'] ??
'');
97 $call_location = reset($called_classes);
101 throw new LogicException(
"context '{$context->getUniqueContextIdentifier()}' already claimed in $first_location, second try in $call_location");
checkCallLocation(ScreenContext $context, bool $silent=false)
withAdditionalData(Collection $collection)
getUniqueContextIdentifier()
claim(ScreenContext $context, bool $silent=false)
push(ScreenContext $context)