Define a specification of PHP entity and check whether the particular item matches it.

1.0.1 2018-04-02 16:06 UTC

This package is auto-updated.

Last update: 2020-08-10 12:17:58 UTC


Build Status Code coverage Quality Score Total Downloads Latest Stable Version License

When might it be useful?

Sometimes you may want to have an unlimited sequence of methods, which cannot be restricted/controlled by the interface. In this case on a "compilation" stage, you can restrict those methods to follow the standards you expect.

A real example from Drupal/Symfony world:


Besides of fully-operable examples, you can check a quick use case:

(new MethodValidator(object<ReflectionMethod>, string<FQCN>))
        (new ArgumentSpecification('form'))
        (new ArgumentSpecification('formState'))