| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function validate(\ReflectionMethod $method) |
||
| 18 | { |
||
| 19 | // - The method must be a member of "SimpleComponent" or its children. |
||
| 20 | // - The method must have 2 arguments (not less and not more, exactly 2). |
||
| 21 | // - The first argument of the method must be of "array" type, passed |
||
| 22 | // by reference and with the "form" name. |
||
| 23 | // - The second argument of the method must be of "\Iterator" type, |
||
| 24 | // not passed by reference and with the "formState" name. |
||
| 25 | (new MethodValidator($method, SimpleComponent::class)) |
||
| 26 | ->addArgument( |
||
| 27 | (new ArgumentSpecification('form')) |
||
| 28 | ->setType('array') |
||
| 29 | ->setOptional(false) |
||
| 30 | ->setPassedByReference(true) |
||
| 31 | ) |
||
| 32 | ->addArgument( |
||
| 33 | (new ArgumentSpecification('formState')) |
||
| 34 | ->setType(\Iterator::class) |
||
| 35 | ->setOptional(false) |
||
| 36 | ->setPassedByReference(false) |
||
| 37 | ); |
||
| 38 | } |
||
| 39 | } |
||
| 40 |