PHP Class Adamgoose\Routing\Annotations\Scanner

Show file Open project: adamgoose/laravel-annotations Class Usage Examples

Protected Properties

Property Type Description
$scan array The path to scan for annotations.

Public Methods

Method Description
__construct ( array $scan ) : void Create a new scanner instance.
create ( array $scan ) : static Create a new scanner instance.
getRouteDefinitions ( ) : string Convert the scanned annotations into route definitions.

Protected Methods

Method Description
addEndpoint ( EndpointCollection $endpoints, ReflectionClass $class, string $method, array $annotations ) : void Create a new endpoint in the collection.
getClassesToScan ( ) : array Get all of the ReflectionClass instances in the scan array.
getEndpointsInClass ( ReflectionClass $class, AnnotationSet $annotations ) : EndpointCollection Build the Endpoints for the given class.
getEndpointsInClasses ( Doctrine\Common\Annotations\SimpleAnnotationReader $reader ) : EndpointCollection Scan the directory and generate the route manifest.
getReader ( ) : Doctrine\Common\Annotations\SimpleAnnotationReader Get an annotation reader instance.

Method Details

__construct() public method

Create a new scanner instance.
public __construct ( array $scan ) : void
$scan array
return void

addEndpoint() protected method

Create a new endpoint in the collection.
protected addEndpoint ( EndpointCollection $endpoints, ReflectionClass $class, string $method, array $annotations ) : void
$endpoints EndpointCollection
$class ReflectionClass
$method string
$annotations array
return void

create() public static method

Create a new scanner instance.
public static create ( array $scan ) : static
$scan array
return static

getClassesToScan() protected method

Get all of the ReflectionClass instances in the scan array.
protected getClassesToScan ( ) : array
return array

getEndpointsInClass() protected method

Build the Endpoints for the given class.
protected getEndpointsInClass ( ReflectionClass $class, AnnotationSet $annotations ) : EndpointCollection
$class ReflectionClass
$annotations AnnotationSet
return EndpointCollection

getEndpointsInClasses() protected method

Scan the directory and generate the route manifest.
protected getEndpointsInClasses ( Doctrine\Common\Annotations\SimpleAnnotationReader $reader ) : EndpointCollection
$reader Doctrine\Common\Annotations\SimpleAnnotationReader
return EndpointCollection

getReader() protected method

Get an annotation reader instance.
protected getReader ( ) : Doctrine\Common\Annotations\SimpleAnnotationReader
return Doctrine\Common\Annotations\SimpleAnnotationReader

getRouteDefinitions() public method

Convert the scanned annotations into route definitions.
public getRouteDefinitions ( ) : string
return string

Property Details

$scan protected property

The path to scan for annotations.
protected array $scan
return array