1 | <?php |
||
22 | class TXT implements RdataInterface |
||
23 | { |
||
24 | 1 | use RdataTrait; |
|
25 | |||
26 | const TYPE = 'TXT'; |
||
27 | const TYPE_CODE = 16; |
||
28 | |||
29 | const WHITESPACE = [Tokens::SPACE, Tokens::TAB, Tokens::LINE_FEED, Tokens::CARRIAGE_RETURN]; |
||
30 | |||
31 | /** |
||
32 | * @var string|null |
||
33 | */ |
||
34 | 31 | private $text; |
|
35 | |||
36 | 31 | public function setText(?string $text): void |
|
46 | |||
47 | 8 | public function getText(): ?string |
|
51 | |||
52 | 9 | public function toText(): string |
|
60 | |||
61 | 1 | public function toWire(): string |
|
65 | |||
66 | 2 | public function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): void |
|
72 | |||
73 | 13 | public function fromText(string $text): void |
|
97 | 15 | ||
98 | 15 | /** |
|
99 | * This handles the case where character string is encapsulated inside quotation marks. |
||
100 | 15 | * |
|
101 | * @param StringIterator $string The string to parse |
||
102 | * @param StringIterator $txt The output string |
||
103 | */ |
||
104 | public static function handleTxt(StringIterator $string, StringIterator $txt): void |
||
121 | |||
122 | /** |
||
123 | * This handles the case where character string is not encapsulated inside quotation marks. |
||
124 | * |
||
125 | * @param StringIterator $string The string to parse |
||
126 | * @param StringIterator $txt The output string |
||
127 | */ |
||
128 | private static function handleContiguousString(StringIterator $string, StringIterator $txt): void |
||
135 | } |
||
136 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.