PHP Class Collective\Annotations\AnnotationsServiceProvider

Inheritance: extends Illuminate\Support\ServiceProvider, use trait Illuminate\Console\AppNamespaceDetectorTrait
Show file Open project: laravelcollective/annotations Class Usage Examples

Protected Properties

Property Type Description
$commands array The commands to be registered.
$finder AnnotationFinder File finder for annotations.
$scanControllers boolean Determines whether or not to automatically scan the controllers directory (App\Http\Controllers) for routes.
$scanEvents array The classes to scan for event annotations.
$scanEverything boolean Determines whether or not to automatically scan all namespaced classes for event, route, and model annotations.
$scanModels array The classes to scan for model binding annotations.
$scanRoutes array The classes to scan for route annotations.
$scanWhenLocal boolean Determines if we will auto-scan in the local environment.

Public Methods

Method Description
__construct ( Illuminate\Contracts\Foundation\Application $app )
addEventAnnotations ( Scanner $scanner ) Add annotation classes to the event scanner.
addModelAnnotations ( Scanner $scanner ) Add annotation classes to the model scanner.
addRoutingAnnotations ( Scanner $scanner ) Add annotation classes to the route scanner.
boot ( ) : void Register the application's annotated event listeners.
convertNamespaceToPath ( string $namespace ) : string Convert the given namespace to a file path.
eventScans ( ) : array Get the classes to be scanned by the provider.
getClassesFromNamespace ( string $namespace, null $base = null ) : array Get a list of the classes in a namespace. Leaving the second argument will scan for classes within the project's app directory.
loadAnnotatedEvents ( ) : void Load the annotated events.
modelScans ( ) : array Get the classes to be scanned by the provider.
register ( ) : void Register the service provider.
routeScans ( ) : array Get the classes to be scanned by the provider.

Protected Methods

Method Description
getAllClasses ( ) : array Get a list of classes in the root namespace.
loadAnnotatedModels ( ) : void Load the annotated models.
loadAnnotatedRoutes ( ) : void Load the annotated routes.
loadScannedEvents ( ) : void Load the scanned events for the application.
loadScannedModels ( ) : void Load the scanned application models.
loadScannedRoutes ( ) : void Load the scanned application routes.
registerCommands ( ) : void Register the commands.
registerEventScanCommand ( ) : void Register the command.
registerEventScanner ( ) : void Register the scanner.
registerModelScanCommand ( ) : void Register the command.
registerModelScanner ( ) : void Register the scanner.
registerRouteScanCommand ( ) : void Register the command.
registerRouteScanner ( ) : void Register the scanner.
scanEvents ( ) : void Scan the events for the application.
scanModels ( ) : void Scan the models and write the scanned models file.
scanRoutes ( ) : void Scan the routes and write the scanned routes file.

Method Details

__construct() public method

public __construct ( Illuminate\Contracts\Foundation\Application $app )
$app Illuminate\Contracts\Foundation\Application

addEventAnnotations() public method

Add annotation classes to the event scanner.
public addEventAnnotations ( Scanner $scanner )
$scanner Collective\Annotations\Events\Annotations\Scanner

addModelAnnotations() public method

Add annotation classes to the model scanner.
public addModelAnnotations ( Scanner $scanner )
$scanner Collective\Annotations\Database\Eloquent\Annotations\Scanner

addRoutingAnnotations() public method

Add annotation classes to the route scanner.
public addRoutingAnnotations ( Scanner $scanner )
$scanner Collective\Annotations\Routing\Annotations\Scanner

boot() public method

Register the application's annotated event listeners.
public boot ( ) : void
return void

convertNamespaceToPath() public method

Convert the given namespace to a file path.
public convertNamespaceToPath ( string $namespace ) : string
$namespace string the namespace to convert
return string

eventScans() public method

Get the classes to be scanned by the provider.
public eventScans ( ) : array
return array

getAllClasses() protected method

Get a list of classes in the root namespace.
protected getAllClasses ( ) : array
return array

getClassesFromNamespace() public method

Get a list of the classes in a namespace. Leaving the second argument will scan for classes within the project's app directory.
public getClassesFromNamespace ( string $namespace, null $base = null ) : array
$namespace string the namespace to search
$base null
return array

loadAnnotatedEvents() public method

Load the annotated events.
public loadAnnotatedEvents ( ) : void
return void

loadAnnotatedModels() protected method

Load the annotated models.
protected loadAnnotatedModels ( ) : void
return void

loadAnnotatedRoutes() protected method

Load the annotated routes.
protected loadAnnotatedRoutes ( ) : void
return void

loadScannedEvents() protected method

Load the scanned events for the application.
protected loadScannedEvents ( ) : void
return void

loadScannedModels() protected method

Load the scanned application models.
protected loadScannedModels ( ) : void
return void

loadScannedRoutes() protected method

Load the scanned application routes.
protected loadScannedRoutes ( ) : void
return void

modelScans() public method

Get the classes to be scanned by the provider.
public modelScans ( ) : array
return array

register() public method

Register the service provider.
public register ( ) : void
return void

registerCommands() protected method

Register the commands.
protected registerCommands ( ) : void
return void

registerEventScanCommand() protected method

Register the command.
protected registerEventScanCommand ( ) : void
return void

registerEventScanner() protected method

Register the scanner.
protected registerEventScanner ( ) : void
return void

registerModelScanCommand() protected method

Register the command.
protected registerModelScanCommand ( ) : void
return void

registerModelScanner() protected method

Register the scanner.
protected registerModelScanner ( ) : void
return void

registerRouteScanCommand() protected method

Register the command.
protected registerRouteScanCommand ( ) : void
return void

registerRouteScanner() protected method

Register the scanner.
protected registerRouteScanner ( ) : void
return void

routeScans() public method

Get the classes to be scanned by the provider.
public routeScans ( ) : array
return array

scanEvents() protected method

Scan the events for the application.
protected scanEvents ( ) : void
return void

scanModels() protected method

Scan the models and write the scanned models file.
protected scanModels ( ) : void
return void

scanRoutes() protected method

Scan the routes and write the scanned routes file.
protected scanRoutes ( ) : void
return void

Property Details

$commands protected property

The commands to be registered.
protected array $commands
return array

$finder protected property

File finder for annotations.
protected AnnotationFinder,Collective\Annotations $finder
return AnnotationFinder

$scanControllers protected property

Determines whether or not to automatically scan the controllers directory (App\Http\Controllers) for routes.
protected bool $scanControllers
return boolean

$scanEvents protected property

The classes to scan for event annotations.
protected array $scanEvents
return array

$scanEverything protected property

Determines whether or not to automatically scan all namespaced classes for event, route, and model annotations.
protected bool $scanEverything
return boolean

$scanModels protected property

The classes to scan for model binding annotations.
protected array $scanModels
return array

$scanRoutes protected property

The classes to scan for route annotations.
protected array $scanRoutes
return array

$scanWhenLocal protected property

Determines if we will auto-scan in the local environment.
protected bool $scanWhenLocal
return boolean