NamedPolicy
in package
implements
PolicyInterface
FinalYes
Wrapper that assigns a stable override key to a policy inside a policy bag.
When multiple policies of the same category share the same name, the later declaration replaces the earlier one within that category.
Table of Contents
Interfaces
- PolicyInterface
- Marker interface for policies that can be declared through a unified bag API.
Properties
- $name : string
- $policy : PolicyInterface
Methods
- as() : self
- Wrap one policy with a stable override name.
- __construct() : mixed
Properties
$name read-only
public
string
$name
$policy read-only
public
PolicyInterface
$policy
Methods
as()
Wrap one policy with a stable override name.
public
static as(string $name, PolicyInterface $policy) : self
Parameters
- $name : string
- $policy : PolicyInterface
Return values
self__construct()
private
__construct(string $name, PolicyInterface $policy) : mixed
Parameters
- $name : string
- $policy : PolicyInterface