| Total Complexity | 5 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class TextLine |
||
| 15 | { |
||
| 16 | /** @var int */ |
||
| 17 | private $lineNumber = 0; |
||
| 18 | |||
| 19 | /** @var string */ |
||
| 20 | private $text = ''; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Default values. |
||
| 24 | * |
||
| 25 | * @param int $lineNumber |
||
| 26 | * @param string $text |
||
| 27 | */ |
||
| 28 | public function __construct(int $lineNumber, string $text) |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @return int |
||
| 36 | */ |
||
| 37 | public function getLineNumber(): int |
||
| 38 | { |
||
| 39 | return $this->lineNumber; |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @return string |
||
| 44 | */ |
||
| 45 | public function getText(): string |
||
| 46 | { |
||
| 47 | return $this->text; |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Compares this TextLine to $other and returns true if they have the same text. |
||
| 52 | * |
||
| 53 | * @param TextLine $other |
||
| 54 | * @return bool |
||
| 55 | */ |
||
| 56 | public function isSameText(TextLine $other): bool |
||
| 57 | { |
||
| 58 | return $this->text === $other->getText(); |
||
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @return string |
||
| 63 | */ |
||
| 64 | public function __toString(): string |
||
| 67 | } |
||
| 68 | } |
||
| 69 |