Collection
class Collection extends ArrayObject
Class Collection - Collection
Constants
| OPERATOR_OR |
|
| OPERATOR_ARRAY |
|
| OPERATOR_NAMESPACE |
|
Properties
| static protected string[] | $keywords | ||
| protected Context | $context | Current invoking location. |
Methods
Registers the namespace and aliases; uses that to add and expand the given types.
Returns the current invoking location.
Adds a new type to the collection and expands it if it contains a relative namespace.
Returns a string representation of the collection.
Analyzes the given type and returns the FQCN variant.
Detects whether the given type represents an array.
Detects whether the given type represents a PHPDoc keyword.
Detects whether the given type represents a relative or absolute path.
Details
at line 50
__construct(array $types = array(), Context $context = null)
Registers the namespace and aliases; uses that to add and expand the given types.
at line 63
Context
getContext()
Returns the current invoking location.
at line 83
void
add(string $type)
Adds a new type to the collection and expands it if it contains a relative namespace.
If a class in the type contains a relative namespace than this collection will try to expand that into a FQCN.
at line 106
string
__toString()
Returns a string representation of the collection.
at line 129
protected string
expand(string $type)
Analyzes the given type and returns the FQCN variant.
When a type is provided this method checks whether it is not a keyword or Fully Qualified Class Name. If so it will use the given namespace and aliases to expand the type to a FQCN representation.
This method only works as expected if the namespace and aliases are set; no dynamic reflection is being performed here.
at line 171
protected bool
isTypeAnArray(string $type)
Detects whether the given type represents an array.
at line 183
protected bool
isTypeAKeyword(string $type)
Detects whether the given type represents a PHPDoc keyword.
at line 198
protected bool
isRelativeType(string $type)
Detects whether the given type represents a relative or absolute path.
This method will detect keywords as being absolute; even though they are not preceeded by a namespace separator.