public function addMethod(ClassMethod $method, $statement = null)
    {
        $methodName = strtolower($method->getName());
        if (isset($this->methods[$methodName])) {
            throw new CompilerException("Method '".$method->getName()."' was defined more than one time", $statement);
        }

        $this->methods[$methodName] = $method;
    }