Completed
Push — master ( 774eb2...689ba3 )
by Richard
07:00
created

CLIReportGenerator::report_violation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 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 licence along with the code.
9
 */
10
11
namespace Lechimp\Dicto\App;
12
13
use Lechimp\Dicto\Analysis\ReportGenerator;
14
use Lechimp\Dicto\Analysis\Violation;
15
use Lechimp\Dicto\Definition\Ruleset;
16
use Lechimp\Dicto\Rules\Rule;
17
18
class CLIReportGenerator implements ReportGenerator {
19
    /**
20
     * @inheritdoc
21
     */
22
    public function start_ruleset(Ruleset $rule) {
23
        echo "Result of analysis:\n\n";
24
    }
25
26
    /**
27
     * @inheritdoc
28
     */
29
    public function start_rule(Rule $rule) {
30
        echo "\n\n".$rule->pprint().":\n\n";
31
    }
32
33
    /**
34
     * @inheritdoc
35
     */
36
    public function report_violation(Violation $violation) {
37
        echo $violation->filename." (".$violation->line_no().")\n";
0 ignored issues
show
Bug introduced by
The property filename cannot be accessed from this context as it is declared protected in class Lechimp\Dicto\Analysis\Violation.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
38
    }
39
}
40