PHP Class Swagger\StaticAnalyser

Show file Open project: zircote/swagger-php Class Usage Examples

Public Methods

Method Description
__construct ( string $filename = null )
fromCode ( string $code, Context $context ) : Analysis Extract and process all doc-comments from the contents.
fromFile ( string $filename ) : Analysis Extract and process all doc-comments from a file.

Protected Methods

Method Description
fromTokens ( array $tokens, Context $parseContext ) : Analysis Shared implementation for parseFile() & parseContents().

Private Methods

Method Description
analyseComment ( Analysis $analysis, Analyser $analyser, string $comment, Context $context )
nextToken ( array &$tokens, Context $context ) : string | array The next non-whitespace, non-comment token.
parseNamespace ( &$tokens, &$token, $parseContext )
parseUseStatement ( &$tokens, &$token, $parseContext )

Method Details

__construct() public method

public __construct ( string $filename = null )
$filename string

fromCode() public method

Extract and process all doc-comments from the contents.
public fromCode ( string $code, Context $context ) : Analysis
$code string PHP code. (including
$context Context The original location of the contents.
return Analysis

fromFile() public method

Extract and process all doc-comments from a file.
public fromFile ( string $filename ) : Analysis
$filename string Path to a php file.
return Analysis

fromTokens() protected method

Shared implementation for parseFile() & parseContents().
protected fromTokens ( array $tokens, Context $parseContext ) : Analysis
$tokens array The result of a token_get_all()
$parseContext Context
return Analysis