Completed
Push — master ( f1c7a7...774eb2 )
by Richard
07:53 queued 02:10
created

Violation   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
A rule() 0 3 1
A filename() 0 3 1
A line_no() 0 3 1
A line() 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 licence along with the code.
9
 */
10
11
namespace Lechimp\Dicto\Analysis;
12
13
use Lechimp\Dicto\Rules\Rule;
14
15
class Violation {
16
    /**
17
     * @var Rule
18
     */
19
    protected $rule;
20
21
    /**
22
     * @var string
23
     */
24
    protected $filename;
25
26
    /**
27
     * @var int
28
     */
29
    protected $line_no;
30
31
    /**
32
     * @var string
33
     */
34
    protected $line;
35
36 6
    public function __construct(Rule $rule, $filename, $line_no, $line) {
37 6
        $this->rule = $rule;
38 6
        assert('is_string($filename)');
39 6
        $this->filename = $filename;
40 6
        assert('is_int($line_no)');
41 6
        $this->line_no = $line_no;
42 6
        assert('is_string($line)');
43 6
        $this->line = $line;
44 6
    }
45
46
    /**
47
     * @return Def\Rules\Rule
48
     */
49 3
    public function rule() {
50 3
        return $this->rule;
51
    }
52
53
    /**
54
     * @return string
55
     */
56 3
    public function filename() {
57 3
        return $this->filename;
58
    }
59
60
    /**
61
     * @return int
62
     */
63 1
    public function line_no() {
64 1
        return $this->line_no;
65
    }
66
67
    /**
68
     * @return string
69
     */
70 1
    public function line() {
71 1
        return $this->line;
72
    }
73
}
74