PicoraDocumentationFunction

Superset of ReflectionFunction

extends ReflectionFunction implements ArrayAccess , Reflector

Similar to a ReflectionFunction object, except that when used as an array, you can access all of the comment information.

$f = new PicoraDocumentationFunction('my_documented_function');
$f->name; //my_documented_function
$f['params']; //array of params (if any)
$f['description']; //string description in doc comment

Declared in: PicoraDocumentation.php

class PicoraDocumentationFunction extends ReflectionFunction implements ArrayAccess {
    protected $comments = array();
    public function __construct($name){
        parent::__construct($name);
        $this->comments = PicoraDocumentation::arrayFromDocComment($this->getDocComment());
        $this->comments['name'] = $name;
        $this->comments['file'] = $this->getFileName();
    }
    public function offsetExists($key){return isset($this->comments[$key]);}
    public function offsetSet($key,$value){$this->comments[$key] = $value;}
    public function offsetGet($key){return $this->comments[$key];}
    public function offsetUnset($key){unset($this->comments[$key]);}
}