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.
Test Failed
Push — master ( ea3c3c...758782 )
by Michael
03:51
created

PublicFieldDeclaration::apply()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 9
rs 9.6666
cc 3
eloc 4
nc 3
nop 1
1
<?php
2
3
namespace MS\PHPMD\Rule\CleanCode;
4
5
use PDepend\Source\AST\ASTFieldDeclaration;
6
use PHPMD\AbstractNode;
7
use PHPMD\AbstractRule;
8
use PHPMD\Node\ClassNode;
9
use PHPMD\Rule\ClassAware;
10
11
/**
12
 * Try to avoid public class variables. Use Getter to access the variable.
13
 */
14
class PublicFieldDeclaration extends AbstractRule implements ClassAware
15
{
16
    /**
17
     * @param AbstractNode|ClassNode $node
18
     */
19
    public function apply(AbstractNode $node)
20
    {
21
        /** @var ASTFieldDeclaration $field */
22
        foreach ($node->findChildrenOfType('FieldDeclaration') as $field) {
23
            if (true === $field->isPublic()) {
24
                $this->addViolation($field);
25
            }
26
        }
27
    }
28
}
29