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.

TraitPublicMethod::apply()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 3
nc 2
nop 1
crap 3
1
<?php
2
3
namespace MS\PHPMD\Rule\CleanCode;
4
5
use PDepend\Source\AST\ASTMethod;
6
use PHPMD\AbstractNode;
7
use PHPMD\AbstractRule;
8
use PHPMD\Node\MethodNode;
9
use PHPMD\Node\TraitNode;
10
use PHPMD\Rule\MethodAware;
11
12
/**
13
 * The purpose of a trait should be the reuse of methods which help the basic classes.
14
 * Make your code clearly and define interfaces of your class as public methods.
15
 */
16
class TraitPublicMethod extends AbstractRule implements MethodAware
17
{
18
    /**
19
     * @param AbstractNode|MethodNode|ASTMethod $node
20
     */
21 23
    public function apply(AbstractNode $node)
22
    {
23 23
        if ($node->getParentType() instanceof TraitNode && true === $node->isPublic()) {
24 1
            $this->addViolation($node);
25 1
        }
26 23
    }
27
}
28