GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( e358d1...217aab )
by Sergii
02:36
created

SimpleAnnotation::validate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 9.2
c 0
b 0
f 0
cc 1
eloc 12
nc 1
nop 1
1
<?php
2
3
namespace Reflection\Examples\Validator\Simple\Annotation;
4
5
use Reflection\Examples\Validator\Simple\Component\SimpleComponent;
6
use Reflection\Validator\Annotation\ReflectionValidatorMethodAnnotationInterface;
7
8
/**
9
 * @Annotation
10
 * @Target({"METHOD"})
11
 */
12
class SimpleAnnotation implements ReflectionValidatorMethodAnnotationInterface
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
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