0 follower

Final Class Yiisoft\Rbac\RuleContext

InheritanceYiisoft\Rbac\RuleContext

Method Details

Hide inherited methods

__construct() public method

public __construct( Yiisoft\Rbac\RuleFactoryInterface $ruleFactory, array $parameters ): mixed
$ruleFactory Yiisoft\Rbac\RuleFactoryInterface
$parameters array

                public function __construct(
    private readonly RuleFactoryInterface $ruleFactory,
    private readonly array $parameters,
) {}

            
createRule() public method

public createRule( string $name ): Yiisoft\Rbac\RuleInterface
$name string

                public function createRule(string $name): RuleInterface
{
    return $this->ruleFactory->create($name);
}

            
getParameterValue() public method

public getParameterValue( string $name ): mixed
$name string

                public function getParameterValue(string $name): mixed
{
    return $this->parameters[$name] ?? null;
}

            
getParameters() public method

public getParameters( ): array

                public function getParameters(): array
{
    return $this->parameters;
}

            
hasParameter() public method

public hasParameter( string $name ): boolean
$name string

                public function hasParameter(string $name): bool
{
    return array_key_exists($name, $this->parameters);
}