| Total Complexity | 6 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 18 | class FlatClassSet extends ArkitectClassSet |
||
| 19 | { |
||
| 20 | private string $directory; |
||
| 21 | |||
| 22 | private array $exclude; |
||
| 23 | |||
| 24 | private function __construct(string $directory) |
||
| 25 | { |
||
| 26 | $this->directory = $directory; |
||
| 27 | $this->exclude = []; |
||
| 28 | } |
||
| 29 | |||
| 30 | public function excludePath(string $pattern): self |
||
| 31 | { |
||
| 32 | $this->exclude[] = Glob::toRegex($pattern); |
||
| 33 | |||
| 34 | return $this; |
||
| 35 | } |
||
| 36 | |||
| 37 | public static function fromDir(string $directory): self |
||
| 38 | { |
||
| 39 | return new self($directory); |
||
| 40 | } |
||
| 41 | |||
| 42 | public function getDir(): string |
||
| 43 | { |
||
| 44 | return $this->directory; |
||
| 45 | } |
||
| 46 | |||
| 47 | public function getIterator() |
||
| 65 | } |
||
| 66 | } |
||
| 67 |
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.