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

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

Get the echo methods in the proper order for compilation.
protected _getEchoMethods ( ) : array
Результат array
    protected function _getEchoMethods()
    {
        $methods = ['_compileRawEchos' => strlen(stripcslashes($this->_rawTags[0])), '_compileEscapedEchos' => strlen(stripcslashes($this->_escapedTags[0]))];
        uksort($methods, function ($method1, $method2) use($methods) {
            // Ensure the longest tags are processed first
            if ($methods[$method1] > $methods[$method2]) {
                return -1;
            }
            if ($methods[$method1] < $methods[$method2]) {
                return 1;
            }
            // Otherwise give preference to raw tags (assuming they've overridden)
            if ($method1 === '_compileRawEchos') {
                return -1;
            }
            if ($method2 === '_compileRawEchos') {
                return 1;
            }
            if ($method1 === '_compileEscapedEchos') {
                return -1;
            }
            if ($method2 === '_compileEscapedEchos') {
                return 1;
            }
            return 0;
        });
        return $methods;
    }