ManaPHP\Renderer\Engine\Sword\Compiler::_compileStatements PHP Метод

_compileStatements() защищенный Метод

Compile Blade statements that start with "@".
protected _compileStatements ( string $value ) : mixed
$value string
Результат mixed
    protected function _compileStatements($value)
    {
        $callback = function ($match) {
            if (method_exists($this, $method = '_compile' . ucfirst($match[1]))) {
                $match[0] = $this->{$method}(isset($match[3]) ? $match[3] : null);
            } elseif (isset($this->_directives[$match[1]])) {
                $match[0] = call_user_func($this->_directives[$match[1]], isset($match[3]) ? $match[3] : null);
            }
            return isset($match[3]) ? $match[0] : $match[0] . $match[2];
        };
        return preg_replace_callback('/\\B@(\\w+)([ \\t]*)(\\( ( (?>[^()]+) | (?3) )* \\))?/x', $callback, $value);
    }