Zephir\CompilerFile::addFunction PHP Method

addFunction() public method

Adds a function to the function definitions
public addFunction ( Compiler $compiler, zephir\FunctionDefinition $func, array $statement = null )
$compiler Compiler
$func zephir\FunctionDefinition
$statement array
    public function addFunction(Compiler $compiler, FunctionDefinition $func, $statement = null)
    {
        $compiler->addFunction($func, $statement);
        $funcName = strtolower($func->getInternalName());
        if (isset($this->_functionDefinitions[$funcName])) {
            throw new CompilerException("Function '" . $func->getName() . "' was defined more than one time (in the same file)", $statement);
        }
        $this->_functionDefinitions[$funcName] = $func;
    }