Completed
Push — master ( 333f55...a94ac3 )
by Richard
05:33
created

Violation   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 52.94%

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 9
cts 17
cp 0.5294
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 2
    public function __construct(Rule $rule, $filename, $line_no, $line) {
37 2
        $this->rule = $rule;
38 2
        assert('is_string($filename)');
39 2
        $this->filename = $filename;
40 2
        assert('is_int($line_no)');
41 2
        $this->line_no = $line_no;
42 2
        assert('is_string($line)');
43 2
        $this->line = $line;
44 2
    }
45
46
    /**
47
     * @return Def\Rules\Rule
48
     */
49
    public function rule() {
50
        return $this->rule;
51
    }
52
53
    /**
54
     * @return string
55
     */
56
    public function filename() {
57
        return $this->filename;
58
    }
59
60
    /**
61
     * @return int
62
     */
63
    public function line_no() {
64
        return $this->line_no;
65
    }
66
67
    /**
68
     * @return string
69
     */
70
    public function line() {
71
        return $this->line;
72
    }
73
}
74