1 | <?php |
||
9 | class Zip |
||
10 | { |
||
11 | /** @var \ZipArchive */ |
||
12 | protected $zipFile; |
||
13 | |||
14 | /** @var int */ |
||
15 | protected $fileCount = 0; |
||
16 | |||
17 | /** @var string */ |
||
18 | protected $pathToZip; |
||
19 | |||
20 | public static function createForPersonalData( |
||
38 | |||
39 | public function __construct(string $pathToZip) |
||
47 | |||
48 | public function path(): string |
||
52 | |||
53 | public function size(): int |
||
61 | |||
62 | public function open(): self |
||
68 | |||
69 | /** |
||
70 | * @param string|array $files |
||
71 | * @param string $rootPath |
||
72 | * |
||
73 | * @return \Spatie\PersonalDataExport\Zip |
||
74 | */ |
||
75 | public function add($files, $rootPath): self |
||
88 | |||
89 | public function close(): self |
||
95 | } |
||
96 |
There are different options of fixing this problem.
If you want to be on the safe side, you can add an additional type-check:
If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:
Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.