Push more directive in template system

@param string $name
@param callable $handler
@param boolean $broken

@return mixed
@throws DirectiveNotAllowException
199343
public function directive($name, $handler, $broken = false)
    {
        $this->compiler->pushDirective($name, $handler, $broken);
    }
253428
public function once(string $name, callable $handler, int $priority = 50, array $extraArguments = []): self
    {
        $this->on($name, $handler, $priority, $extraArguments);
        $handlerId = $this->handler->getKey($handler);
        $this->listeners[$name][$priority][$handlerId]['once'] = true;

        return $this;
    }
511400
public function make($name, callable  $callable)
    {
        $breadcrumb = new Breadcrumb($callable);
        $breadcrumb->route($name);

        $this->collection->put($name, $breadcrumb);
    }
853073
protected function runCommand(string $name, $handler, array $options)
    {
        if (\is_object($handler) && \method_exists($handler, '__invoke')) {
            if ($this->input->getSameOpt(['h', 'help'])) {
                $desc = $options['description'] ?? 'No command description message';

                return $this->output->write($desc);
            }

            $result = $handler($this->input, $this->output);
        } else {
            if (!\class_exists($handler)) {
                Helper::throwInvalidArgument("The console command class [$handler] not exists!");
            }

            /** @var Command $object */
            $object = new $handler($this->input, $this->output);

            if (!($object instanceof Command)) {
                Helper::throwInvalidArgument("The console command class [$handler] must instanceof the " . Command::class);
            }

            $object::setName($name);
            $object->setApp($this);
            $result = $object->run();
        }

        return $result;
    }
1321922
public function attachHandler(callable $handler, $key = null)
    {
        if ($key !== null) {
            $this->eventHandlers[$key] = $handler;
        } else {
            $this->eventHandlers[] = $handler;
        }
    }
232611
public function register($name, $handler)
    {
        Assert::string($name, 'The handler name must be a string. Got: %s');
        Assert::notEmpty($name, 'The handler name must not be empty.');

        if (!is_object($handler)) {
            Assert::isCallable($handler, 'The handler must be a callable or an object. Got: %s');
        }

        $this->handlers[$name] = $handler;

        if (!$this->selectedHandler) {
            $this->selectedHandler = $name;
        }
    }
651788
public static function macro($name, callable $fn)
    {
        if (!in_array($name, self::$_rulesMap)) {
            self::$_rulesMap[$name] = $fn;
            return true;
        }

        return false;
    }
743151
public function hasHandlers($name, $handler = null)
    {
        $args = new Args;
        $this->runByHandler($name, $handler, [$this, 'hasHandler'], $args);
        $result = $args->get('hasHandler');

        return $result;
    }
834321
public function post(
        string $definition,
        RequestHandlerInterface $handler,
        ?string $name = null,
        $data = null
    ): Route {
        return $this->route(Method::POST, $definition, $handler, $name, $data);
    }
1341026
public function addHandler($name, $handler)
    {
        $tmp        = $this->relationHandlers->getValue($this->entity);
        $tmp[$name] = $handler;
        $this->relationHandlers->setValue($this->entity, $tmp);
    }
1152280
public function addOptions(string $uri, string $handler, string $name = null)
    {
        $this->addRoute("OPTIONS", $uri, $handler, $name);
    }
119069
public function render(RenderHandler $handler)
    {
        if (!empty($this->delay)) {
            $handler->add($this->directive, $this->delay);
        }
        return true;
    }
730155
public function getPushHandler($name)
    {
        if (!$this->hasPushHandler($name)) {
            throw new \InvalidArgumentException(sprintf('A push handler named "%s" has not been registered.', $name));
        }

        return $this->pushHandlers[$name];
    }
728303
function _stop_element_handler($parser, $name)
    {
        if (isset($this->current)) {
            $this->current = new Math_BigInteger(base64_decode($this->current), 256);
            unset($this->current);
        }
    }
631271
public function on(string $name, callable $handler, int $priority = 50, array $extraArguments = [])
    {
        $handlerId = $this->handler->getKey($handler);
        $this->listeners[$name][$priority][$handlerId] = [
            'handler' => $handler,
            'extraArguments' => $extraArguments,
            'priority' => $priority,
        ];

        $this->sorted[$name] = false;

        return $this;
    }
684673
public function patch(
        string $definition,
        RequestHandlerInterface $handler,
        ?string $name = null,
        $data = null
    ): Route {
        return $this->route(Method::PATCH, $definition, $handler, $name, $data);
    }
169347
public function detachHandler($name, callable $callback)
    {
        if (! isset($this->events[$name])) {
            return false;
        }
        $index = array_search($callback, $this->events[$name], true);
        if ($index === false) {
            return false;
        }
        unset($this->events[$name][$index]);
        return true;
    }