protected function getClassMethods($class)
    {
        // Get a reflection class.
        $classReflection = new \ReflectionClass($class);
        $methods = $classReflection->getMethods();

        $metaData = [];
        $methodData = [];

        foreach ($methods as $method) {
            $methodData['name'] = $method->getName();

            $filename = $method->getFileName();
            $source = file($filename);
            $startLine = $method->getStartLine();

            $methodData['declaration'] = substr(trim($source[$startLine - 1]), 0, -1);

            $methodDocComment = explode("\n", $method->getDocComment());
            foreach ($methodDocComment as $line) {
                if (substr($line, 0, 5) == '   * ') {
                    $methodData['description'] = substr($line, 5);
                    break;
                }
            }

            $metaData[$method->getName()] = $methodData;
        }

        return $metaData;
    }
protected function getClassMethods($class)
    {
        // Get a reflection class.
        $classReflection = new \ReflectionClass($class);
        $methods = $classReflection->getMethods();

        $metaData = [];
        $methodData = [];

        foreach ($methods as $method) {
            $methodData['name'] = $method->getName();

            $filename = $method->getFileName();
            $source = file($filename);
            $startLine = $method->getStartLine();

            $methodData['declaration'] = substr(trim($source[$startLine - 1]), 0, -1);

            $methodDocComment = explode("\n", $method->getDocComment());
            foreach ($methodDocComment as $line) {
                if (substr($line, 0, 5) == '   * ') {
                    $methodData['description'] = substr($line, 5);
                    break;
                }
            }

            $metaData[$method->getName()] = $methodData;
        }

        return $metaData;
    }
protected function getClassMethods ( $ class ) { // Get a reflection class. $ classReflection = new \ ReflectionClass ( $ class ) ; $ methods = $ classReflection -> getMethods ( ) ; $ metaData = [ ] ; $ methodData = [ ] ; foreach ( $ methods as $ method ) { $ methodData [ 'name' ] = $ method -> getName ( ) ; $ filename = $ method -> getFileName ( ) ; $ source = file ( $ filename ) ; $ startLine = $ method -> getStartLine ( ) ; $ methodData [ 'declaration' ] = substr ( trim ( $ source [ $ startLine - 1 ] ) , 0 , - 1 ) ; $ methodDocComment = explode ( "\n" , $ method -> getDocComment ( ) ) ; foreach ( $ methodDocComment as $ line ) { if ( substr ( $ line , 0 , 5 ) == '   * ' ) { $ methodData [ 'description' ] = substr ( $ line , 5 ) ; break ; } } $ metaData [ $ method -> getName ( ) ] = $ methodData ; } return $ metaData ; }
Get data for the methods of a class.

@param $class
The fully-qualified name of class.

@return
An array keyed by method name, where each value is an array containing:
- 'name: The name of the method.
- 'declaration': The function declaration line.
- 'description': The description from the method's docblock first line.
Get data for the methods of a class .