leave example



        if (!$transitionExist) {
            throw new UndefinedTransitionException($subject$transitionName$this$context);
        }

        if (!$approvedTransitions) {
            throw new NotEnabledTransitionException($subject$transitionName$this$bestTransitionBlockerList$context);
        }

        foreach ($approvedTransitions as $transition) {
            $this->leave($subject$transition$marking$context);

            $context = $this->transition($subject$transition$marking$context);

            $this->enter($subject$transition$marking$context);

            $this->markingStore->setMarking($subject$marking$context);

            $this->entered($subject$transition$marking$context);

            $this->completed($subject$transition$marking$context);

            
public function enter(Profile $profile)
    {
        $this->actives[0]->addProfile($profile);
        array_unshift($this->actives, $profile);
    }

    /** * @return void */
    public function leave(Profile $profile)
    {
        $profile->leave();
        array_shift($this->actives);

        if (1 === \count($this->actives)) {
            $this->actives[0]->leave();
        }
    }

    public function getNodeVisitors(): array
    {
        return [new ProfilerNodeVisitor(static::class)];
    }
}
public function enter(Profile $profile): void
    {
        if ($this->stopwatch && $profile->isTemplate()) {
            $this->events[$profile] = $this->stopwatch->start($profile->getName(), 'template');
        }

        parent::enter($profile);
    }

    public function leave(Profile $profile): void
    {
        parent::leave($profile);

        if ($this->stopwatch && $profile->isTemplate()) {
            $this->events[$profile]->stop();
            unset($this->events[$profile]);
        }
    }
}
return $node;
    }

    protected function doLeaveNode(Node $node, Environment $env): ?Node
    {
        if ($node instanceof TransDefaultDomainNode) {
            return null;
        }

        if ($node instanceof BlockNode || $node instanceof ModuleNode) {
            $this->scope = $this->scope->leave();
        }

        return $node;
    }

    public function getPriority(): int
    {
        return -10;
    }

    private function isNamedArguments(Node $arguments): bool
    {
Home | Imprint | This part of the site doesn't use cookies.