@@ -144,7 +144,8 @@ public function process(\DOMDocument $document, File $file): array
144144 throw new \LogicException ('Could not map simpara violation to source content. ' );
145145 }
146146
147- if ($ match ['selfClosing ' ]) {
147+ $ closingOffset = $ match ['closingOffset ' ];
148+ if (null === $ closingOffset ) {
148149 continue ;
149150 }
150151
@@ -160,11 +161,6 @@ public function process(\DOMDocument $document, File $file): array
160161 continue ;
161162 }
162163
163- $ closingOffset = $ match ['closingOffset ' ];
164- if ($ closingOffset === null ) {
165- throw new \LogicException ('Could not map simpara violation to source content. ' );
166- }
167-
168164 $ affectedRanges = $ this ->elementNameRanges (
169165 $ file ,
170166 $ match ['beginOffset ' ],
@@ -219,13 +215,7 @@ private function getAllowedElements(): array
219215 |> array_values (...);
220216 }
221217
222- /**
223- * @return list<array{
224- * beginOffset: int,
225- * selfClosing: bool,
226- * closingOffset: int|null
227- * }>
228- */
218+ /** @return list<array{beginOffset: int, closingOffset: int|null}> */
229219 private function sourceMatches (File $ file ): array
230220 {
231221 preg_match_all (
@@ -245,7 +235,6 @@ private function sourceMatches(File $file): array
245235 if (str_ends_with (rtrim ($ tag ), '/> ' )) {
246236 $ sourceMatches [] = [
247237 'beginOffset ' => $ offset ,
248- 'selfClosing ' => true ,
249238 'closingOffset ' => null ,
250239 ];
251240 continue ;
@@ -262,7 +251,6 @@ private function sourceMatches(File $file): array
262251
263252 $ sourceMatches [] = [
264253 'beginOffset ' => $ opening ,
265- 'selfClosing ' => false ,
266254 'closingOffset ' => $ offset ,
267255 ];
268256 }
0 commit comments