Closed danielspk closed 1 year ago
Hello. Is this project still active?
You need to switch to typing the validators by the interface:
public function assertValidator(Validatable $validator, $value)
{
// ...
}
Using the Validatable
interface instead of Validator
façade will make PhpStorm typing checks work.
We don't recommend reusing the façade as a composition in your internal code. If you're building validators dynamically, you should read about the Concrete API and create new Rules\...
by yourself.
Hello. The
StaticValidator
interface indicates for example that the static methodstringType
returns aChainedValidator
, but in reality it returns aValidator
.Example:
This behavior for example causes PhpStorm to report a warning incorrectly:
Expected parameter of type '\Respect\Validation\Validator', '\Respect\Validation\ChainedValidator' provided