| Total Complexity | 5 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | final class EdifactParser |
||
| 14 | { |
||
| 15 | private SegmentFactoryInterface $segmentFactory; |
||
| 16 | |||
| 17 | 3 | public static function createWithDefaultSegments(): self |
|
| 18 | { |
||
| 19 | 3 | return new self(SegmentFactory::withDefaultSegments()); |
|
| 20 | } |
||
| 21 | |||
| 22 | 4 | public function __construct(SegmentFactoryInterface $segmentFactory) |
|
| 25 | 4 | } |
|
| 26 | |||
| 27 | /** @codeCoverageIgnore */ |
||
| 28 | private function __clone() |
||
| 29 | { |
||
| 30 | } |
||
| 31 | |||
| 32 | /** @return TransactionMessage[] */ |
||
| 33 | 4 | public function parse(string $fileContent): array |
|
| 46 | } |
||
| 47 | } |
||
| 48 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)or! empty(...)instead.