Fr3nch13/CakePHP Utilities

RulesProvider
in package

A Proxy class used to remove any extra arguments when the user intended to call a method in another class that is not aware of validation providers signature

Table of Contents

Properties

$_class  : object|string
The class/object to proxy.
$_reflection  : ReflectionClass
The proxied class' reflection

Methods

__call()  : bool
Proxies validation method calls to the Validation class.
__construct()  : mixed
Constructor, sets the default class to use for calling methods
extension()  : bool

Properties

$_class

The class/object to proxy.

protected object|string $_class

$_reflection

The proxied class' reflection

protected ReflectionClass $_reflection

Methods

__call()

Proxies validation method calls to the Validation class.

public __call(string $method, array<string|int, mixed> $arguments) : bool

The last argument (context) will be sliced off, if the validation method's last parameter is not named 'context'. This lets the various wrapped validation methods to not receive the validation context unless they need it.

Parameters
$method : string

the validation method to call

$arguments : array<string|int, mixed>

the list of arguments to pass to the method

Return values
bool

Whether the validation rule passed

__construct()

Constructor, sets the default class to use for calling methods

public __construct([object|string $class = Validation::class ]) : mixed
Parameters
$class : object|string = Validation::class

the default class to proxy

Tags
throws
ReflectionException
psalm-param

object|class-string $class

extension()

public extension([mixed $check = ][, array<string|int, mixed> $extensions = ][, array<string|int, mixed> $context = [] ]) : bool
Parameters
$check : mixed =
$extensions : array<string|int, mixed> =
$context : array<string|int, mixed> = []
Return values
bool

        
On this page

Search results