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.

SimpleAnnotation   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 28
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A validate() 0 22 1
1
<?php
2
3
namespace Reflection\Examples\Validator\Simple\Annotation;
4
5
use Reflection\Validator\MethodValidator;
6
use Reflection\Validator\ArgumentSpecification;
7
use Reflection\Validator\Annotation\ReflectionValidatorMethodAnnotationInterface;
8
use Reflection\Examples\Validator\Simple\Component\SimpleComponent;
9
10
/**
11
 * @Annotation
12
 * @Target({"METHOD"})
13
 */
14
class SimpleAnnotation implements ReflectionValidatorMethodAnnotationInterface
15
{
16
    /**
17
     * {@inheritdoc}
18
     */
19
    public function validate(\ReflectionMethod $method)
20
    {
21
        // - The method must be a member of "SimpleComponent" or its children.
22
        // - The method must have 2 arguments (not less and not more, exactly 2).
23
        // - The first argument of the method must be of "array" type, passed
24
        //   by reference and with the "form" name.
25
        // - The second argument of the method must be of "\Iterator" type,
26
        //   not passed by reference and with the "formState" name.
27
        (new MethodValidator($method, SimpleComponent::class))
28
            ->addArgument(
29
                (new ArgumentSpecification('form'))
30
                    ->setType('array')
31
                    ->setOptional(false)
32
                    ->setPassedByReference(true)
33
            )
34
            ->addArgument(
35
                (new ArgumentSpecification('formState'))
36
                    ->setType(\Iterator::class)
37
                    ->setOptional(false)
38
                    ->setPassedByReference(false)
39
            );
40
    }
41
}
42