Completed
Push — master ( 178b4a...1f981d )
by Richard
06:19
created

AnalyzerFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 66.67%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 2
c 3
b 0
f 0
lcom 1
cbo 1
dl 0
loc 28
ccs 4
cts 6
cp 0.6667
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A build() 0 3 1
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