Completed
Push — master ( 178b4a...1f981d )
by Richard
06:19
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 3
Bugs 0 Features 0
Metric Value
c 3
b 0
f 0
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 2
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 Ruleset
28
     */
29
    protected $ruleset;
30
31 1
    public function __construct
32
                        ( Log $log
33
                        , RuleSet $ruleset
34
                        ) {
35 1
        $this->log = $log;
36 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...
37 1
    }
38
39
    /**
40
     * @param   Query               $query
41
     * @param   ReportGenerator     $report_generator
42
     * @return  Analyzer
43
     */
44
    public function build(Query $query, ReportGenerator $report_generator) {
45
        return new Analyzer($this->log, $this->ruleset, $query, $report_generator);
46
    }
47
} 
48