| Total Complexity | 5 |
| Total Lines | 61 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class Violation implements ViolationInterface |
||
| 14 | { |
||
| 15 | /** @var string */ |
||
| 16 | private $message; |
||
| 17 | |||
| 18 | /** @var CandidateInterface */ |
||
| 19 | private $result; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Constructor. |
||
| 23 | * |
||
| 24 | * @param string $message |
||
| 25 | * @param CandidateInterface $result |
||
| 26 | */ |
||
| 27 | 1 | public function __construct(string $message, CandidateInterface $result) |
|
| 28 | { |
||
| 29 | 1 | $this->message = $message; |
|
| 30 | 1 | $this->result = $result; |
|
| 31 | 1 | } |
|
| 32 | |||
| 33 | /** |
||
| 34 | * Get the violation message. |
||
| 35 | * |
||
| 36 | * @return string |
||
| 37 | */ |
||
| 38 | 1 | public function getMessage(): string |
|
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Get the composer package. |
||
| 45 | * |
||
| 46 | * @return PackageInterface |
||
| 47 | */ |
||
| 48 | 1 | public function getPackage(): PackageInterface |
|
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Get the symbols. |
||
| 55 | * |
||
| 56 | * @return SymbolIteratorInterface |
||
| 57 | */ |
||
| 58 | 1 | public function getSymbols(): SymbolIteratorInterface |
|
| 59 | { |
||
| 60 | 1 | return $this->result->getSymbols(); |
|
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * Specify data that should be serialized to JSON. |
||
| 65 | * |
||
| 66 | * @return array |
||
| 67 | */ |
||
| 68 | 1 | public function jsonSerialize(): array |
|
| 74 | ]; |
||
| 75 | } |
||
| 76 | } |
||
| 77 |