Completed
Push — master ( dca6dc...178b4a )
by Richard
06:29
created

AnalyzerFactory::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
/******************************************************************************
3
 * An implementation of dicto (scg.unibe.ch/dicto) in and for PHP.
4
 *
5
 * Copyright (c) 2016, 2015 Richard Klees <[email protected]>
6
 *
7
 * This software is licensed under The MIT License. You should have received
8
 * a copy of the license along with the code.
9
 */
10
11
namespace Lechimp\Dicto\Analysis;
12
13
use Lechimp\Dicto\Analysis\Query;
14
use Lechimp\Dicto\Rules\RuleSet;
15
use Psr\Log\LoggerInterface as Log;
16
17
/**
18
 * Creates analyzers.
19
 */
20
class AnalyzerFactory {
21
    /**
22
     * @var Log
23
     */
24
    protected $log;
25
26
    /**
27
     * @var ReportGenerator
28
     */
29
    protected $generator;
30
31
    /**
32
     * @var Ruleset
33
     */
34
    protected $ruleset;
35
36 1
    public function __construct
37
                        ( Log $log
38
                        , ReportGenerator $generator
39
                        , RuleSet $ruleset
40
                        ) {
41 1
        $this->log = $log;
42 1
        $this->generator = $generator;
43 1
        $this->ruleset = $ruleset;
0 ignored issues
show
Documentation Bug introduced by
It seems like $ruleset of type object<Lechimp\Dicto\Rules\Ruleset> is incompatible with the declared type object<Lechimp\Dicto\Analysis\Ruleset> of property $ruleset.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
44 1
    }
45
46
    /**
47
     * @param   RuleSet     $ruleset
0 ignored issues
show
Bug introduced by
There is no parameter named $ruleset. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
48
     * @param   Query       $query
49
     * @return  Analyzer
50
     */
51
    public function build(Query $query) {
52
        return new Analyzer($this->log, $this->ruleset, $query, $this->generator);
53
    }
54
} 
55