Conditions | 2 |
Paths | 3 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php declare(strict_types = 1); |
||
41 | private function validateXMLReader(XMLReader $xml): XMLReader |
||
42 | { |
||
43 | try { |
||
44 | @$xml->open(uri: $this->path); |
||
|
|||
45 | $xml->read(); |
||
46 | } catch (Throwable $throwable) { |
||
47 | throw new InvalidXLSXFileException(path: $this->path, previous: $throwable); |
||
48 | } |
||
49 | |||
50 | return $xml; |
||
51 | } |
||
53 |
If you suppress an error, we recommend checking for the error condition explicitly: