ProjectFactoryStrategies
in package
implements
StrategyContainer
FinalYes
Table of Contents
Interfaces
- StrategyContainer
- Interface for strategy containers.
Constants
- DEFAULT_PRIORITY = 1000
Properties
- $strategies : SplPriorityQueue<int, ProjectFactoryStrategy>
Methods
- __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 read-only
private
SplPriorityQueue<int, ProjectFactoryStrategy>
$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>
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
findMatching()
Find the ProjectFactoryStrategy that matches $object.
public
findMatching(ContextStack $context, mixed $object) : ProjectFactoryStrategy
Parameters
- $context : ContextStack
- $object : mixed
Tags
Attributes
- #[Override]