ProjectFactoryStrategies
in package
implements
StrategyContainer
Interfaces, Classes and Traits
- StrategyContainer
- Interface for strategy containers.
Table of Contents
- DEFAULT_PRIORITY = 1000
- $strategies : SplPriorityQueue
- __construct() : mixed
- Initializes the factory with a number of strategies.
- addStrategy() : void
- Add a strategy to this container.
- findMatching() : ProjectFactoryStrategy
- Find the ProjectFactoryStrategy that matches $object.
Constants
DEFAULT_PRIORITY
public
mixed
DEFAULT_PRIORITY
= 1000
Properties
$strategies
private
SplPriorityQueue
$strategies
Methods
__construct()
Initializes the factory with a number of strategies.
public
__construct(array<string|int, ProjectFactoryStrategy> $strategies) : mixed
Parameters
- $strategies : array<string|int, ProjectFactoryStrategy>
Return values
mixed —addStrategy()
Add a strategy to this container.
public
addStrategy(ProjectFactoryStrategy $strategy[, int $priority = self::DEFAULT_PRIORITY ]) : void
Parameters
- $strategy : ProjectFactoryStrategy
- $priority : int = self::DEFAULT_PRIORITY
Return values
void —findMatching()
Find the ProjectFactoryStrategy that matches $object.
public
findMatching(ContextStack $context, mixed $object) : ProjectFactoryStrategy
Parameters
- $context : ContextStack
- $object : mixed