PHP Class Yosymfony\Spress\Core\Plugin\PluginManagerBuilder

Author: Victor Puertas ([email protected])
Datei anzeigen Open project: spress/spress Class Usage Examples

Protected Properties

Property Type Description
$composerFilename
$eventDispatcher
$excludeDirs
$path
$resolver

Public Methods

Method Description
__construct ( string $path, EventDispatcher $eventDispatcher, array $excludeDirs = [] ) Constructor.
build ( ) : PluginManager Builds the PluginManager with the plugins of a site.
setComposerFilename ( string $name ) Sets the composer filename. "composer.json" by default.

Protected Methods

Method Description
buildFinder ( )
getClassname ( Symfony\Component\Finder\SplFileInfo $file ) : string Gets the class name.
getPluginMetas ( Yosymfony\Spress\Core\Plugin\PluginInterface $plugin ) : array Gets metas of a plugin.
getResolver ( ) : Yosymfony\Spress\Core\Support\AttributesResolver\AttributesResolver Gets the attribute resolver.
isValidClassName ( string $name ) : boolean Checks if the class name is valid.
readComposerFile ( Symfony\Component\Finder\SplFileInfo $file ) : array Reads a "composer.json" file.

Method Details

__construct() public method

Constructor.
public __construct ( string $path, EventDispatcher $eventDispatcher, array $excludeDirs = [] )
$path string Path to plugin folder
$eventDispatcher Symfony\Component\EventDispatcher\EventDispatcher
$excludeDirs array List of directories excluded of the scan for discovering class. Tests directories are a good example

build() public method

Each plugin is added to PluginManager using "name" meta or its classname if that meta do not exists.
public build ( ) : PluginManager
return PluginManager

buildFinder() protected method

protected buildFinder ( )

getClassname() protected method

Gets the class name.
protected getClassname ( Symfony\Component\Finder\SplFileInfo $file ) : string
$file Symfony\Component\Finder\SplFileInfo
return string

getPluginMetas() protected method

Gets metas of a plugin.
protected getPluginMetas ( Yosymfony\Spress\Core\Plugin\PluginInterface $plugin ) : array
$plugin Yosymfony\Spress\Core\Plugin\PluginInterface The plugin
return array

getResolver() protected method

Gets the attribute resolver.
protected getResolver ( ) : Yosymfony\Spress\Core\Support\AttributesResolver\AttributesResolver
return Yosymfony\Spress\Core\Support\AttributesResolver\AttributesResolver

isValidClassName() protected method

Checks if the class name is valid.
protected isValidClassName ( string $name ) : boolean
$name string
return boolean

readComposerFile() protected method

Reads a "composer.json" file.
protected readComposerFile ( Symfony\Component\Finder\SplFileInfo $file ) : array
$file Symfony\Component\Finder\SplFileInfo
return array The parsed json filename

setComposerFilename() public method

Sets the composer filename. "composer.json" by default.
public setComposerFilename ( string $name )
$name string The filename

Property Details

$composerFilename protected_oe property

protected $composerFilename

$eventDispatcher protected_oe property

protected $eventDispatcher

$excludeDirs protected_oe property

protected $excludeDirs

$path protected_oe property

protected $path

$resolver protected_oe property

protected $resolver