Completed
Push — master ( cfa785...3f4fca )
by Дмитрий
02:53
created

Factory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 9

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 32
ccs 17
cts 17
cp 1
rs 10
wmc 1
lcom 0
cbo 9

1 Method

Rating   Name   Duplication   Size   Complexity  
B factory() 0 25 1
1
<?php
2
/**
3
 * @author Patsura Dmitry https://github.com/ovr <[email protected]>
4
 */
5
6
namespace PHPSA\Analyzer;
7
8
use PHPSA\Analyzer;
9
use Webiny\Component\EventManager\EventManager;
10
use PHPSA\Analyzer\Pass as AnalyzerPass;
11
12
class Factory
13
{
14
    /**
15
     * @param EventManager $eventManager
16
     * @return Analyzer
17
     */
18 1
    static public function factory(EventManager $eventManager)
0 ignored issues
show
Best Practice introduced by
Using PHP4-style constructors that are named like the class is not recommend; better use the more explicit __construct method.
Loading history...
Coding Style introduced by
As per PSR2, the static declaration should come after the visibility declaration.
Loading history...
19
    {
20 1
        $analyzer = new Analyzer($eventManager);
21 1
        $analyzer->registerExpressionPasses(
22
            [
23
                // Another
24 1
                new AnalyzerPass\Expression\ArrayShortDefinition(),
25
                // Function call
26 1
                new AnalyzerPass\Expression\FunctionCall\AliasCheck(),
27 1
                new AnalyzerPass\Expression\FunctionCall\DebugCode(),
28 1
                new AnalyzerPass\Expression\FunctionCall\RandomApiMigration(),
29 1
                new AnalyzerPass\Expression\FunctionCall\UseCast(),
30 1
                new AnalyzerPass\Expression\FunctionCall\DeprecatedIniOptions(),
31 1
                new AnalyzerPass\Expression\FunctionCall\RegularExpressions(),
32
            ]
33 1
        );
34 1
        $analyzer->registerStatementPasses(
35
            [
36 1
                new AnalyzerPass\Statement\MethodCannotReturn()
37 1
            ]
38 1
        );
39 1
        $analyzer->bind();
40
41 1
        return $analyzer;
42
    }
43
}
44