protected function getFileFunctions($filePath)
    {
        $source = file_get_contents($filePath);
        $tokens = token_get_all($source);

        $functions = [];
        $nextStringIsFunc = false;
        foreach($tokens as $token) {
            switch($token[0]) {
                case T_FUNCTION:
                    $nextStringIsFunc = true;
                    break;

                case T_STRING:
                    if ($nextStringIsFunc) {
                        $nextStringIsFunc = false;
                        $functions[] = $token[1];
                    }
                    break;
            }
        }

        return $functions;
    }
protected function getFileFunctions($filePath)
    {
        $source = file_get_contents($filePath);
        $tokens = token_get_all($source);

        $functions = [];
        $nextStringIsFunc = false;
        foreach($tokens as $token) {
            switch($token[0]) {
                case T_FUNCTION:
                    $nextStringIsFunc = true;
                    break;

                case T_STRING:
                    if ($nextStringIsFunc) {
                        $nextStringIsFunc = false;
                        $functions[] = $token[1];
                    }
                    break;
            }
        }

        return $functions;
    }
protected function getFileFunctions ( $ filePath ) { $ source = file_get_contents ( $ filePath ) ; $ tokens = token_get_all ( $ source ) ; $ functions = [ ] ; $ nextStringIsFunc = false ; foreach ( $ tokens as $ token ) { switch ( $ token [ 0 ] ) { case T_FUNCTION : $ nextStringIsFunc = true ; break ; case T_STRING : if ( $ nextStringIsFunc ) { $ nextStringIsFunc = false ; $ functions [ ] = $ token [ 1 ] ; } break ; } } return $ functions ; }
Get names of all functions from file.

@param string $filePath
File path
@return array
Functions list.
Get names of all functions from file .