Convenience class to create a Context for DocBlocks when not using the Reflection Component of phpDocumentor.
For a DocBlock to be able to resolve types that use partial namespace names or rely on namespace imports we need to provide a bit of context so that the DocBlock can read that and based on it decide how to resolve the types to Fully Qualified names.
- see \Contextfor more information.
Methods |
public createForNamespace(string $namespace, string $fileContents) : phpDocumentor Build a Context for a namespace in the provided file contents.
|
public createFromReflector(Reflector $reflector) : phpDocumentor Build a Context given a Class Reflection.
|
Constants |
private phpDocumentor The literal used at the end of a use statement. |
private phpDocumentor The literal used between sets of use statements |
Methods |
private createFromReflectionClass(ReflectionClass $class) : phpDocumentor
|
private createFromReflectionClassConstant(ReflectionClassConstant $constant) : phpDocumentor |
private createFromReflectionMethod(ReflectionMethod $method) : phpDocumentor |
private createFromReflectionParameter(ReflectionParameter $parameter) : phpDocumentor |
private createFromReflectionProperty(ReflectionProperty $property) : phpDocumentor |
private extractUseStatements(ArrayIterator $tokens) : array Deduce the namespace name and alias of an import when we are at the T_USE token or have not reached the end of a USE statement yet. This will return a key/value array of the alias => namespace.
|
private parseNamespace(ArrayIterator $tokens) : string Deduce the name from tokens when we are at the T_NAMESPACE token.
|
private parseUseStatement(ArrayIterator $tokens) : array Deduce the names of all imports when we are at the T_USE token.
|
private skipToNextStringOrNamespaceSeparator(ArrayIterator $tokens) : void Fast-forwards the iterator as longs as we don't encounter a T_STRING or T_NS_SEPARATOR token.
|