Completed
Pull Request — master (#139)
by Kévin
03:44
created

DoNotUseGoto::getConfiguration()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 9
ccs 0
cts 5
cp 0
crap 2
rs 9.6666

1 Method

Rating   Name   Duplication   Size   Complexity  
A DoNotUseGoto::getRegister() 0 6 1
1
<?php
2
3
namespace PHPSA\Analyzer\Pass\Statement;
4
5
use PhpParser\Node\Stmt;
6
use PHPSA\Analyzer\Helper\DefaultMetadataPassTrait;
7
use PHPSA\Analyzer\Pass;
8
use PHPSA\Context;
9
10
class DoNotUseGoto implements Pass\AnalyzerPassInterface
11
{
12
    use DefaultMetadataPassTrait;
13
14
    /**
15
     * @param Stmt\Goto_ $stmt
16
     * @param Context $context
17
     * @return bool
18
     */
19 1
    public function pass(Stmt\Goto_ $stmt, Context $context)
20
    {
21 1
        $context->notice('do_not_use_goto', 'Do not use goto statements', $stmt);
22
23 1
        return true;
24
    }
25
26
    /**
27
     * @return array
28
     */
29 1
    public function getRegister()
30
    {
31
        return [
32 1
            Stmt\Goto_::class,
33 1
        ];
34
    }
35
}
36