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