BetterReflection\Reflection\ReflectionClass::addMethod PHP Method

addMethod() public method

Add a new method to the class.
public addMethod ( string $methodName )
$methodName string
    public function addMethod($methodName)
    {
        $this->node->stmts[] = new ClassMethod($methodName);
        unset($this->cachedMethods);
    }

Usage Example

 /**
  * {@inheritdoc}
  */
 public function addMethod($methodName)
 {
     return $this->reflectionClass->addMethod($methodName);
 }