-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Issue.php
49 lines (41 loc) · 973 Bytes
/
Issue.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
declare(strict_types=1);
namespace SPFLib\Semantic;
use SPFLib\Record;
/**
* Class that represent a semantic issue reported by SemanticVamidator.
*/
class Issue extends AbstractIssue
{
/**
* The affected record.
*
* @var \SPFLib\Record
*/
private $record;
/**
* Initialize the instance.
*/
public function __construct(Record $record, int $code, string $description, int $level)
{
parent::__construct($code, $description, $level);
$this->record = $record;
}
/**
* {@inheritdoc}
*
* @see \SPFLib\Semantic\AbstractIssue::__toString()
*/
public function __toString(): string
{
$level = $this->getLevelDescription();
return $level === '' ? $this->getDescription() : "[{$level}] {$this->getDescription()}";
}
/**
* Get the affected record.
*/
public function getRecord(): Record
{
return $this->record;
}
}