1 | <?php |
||
7 | class Zip |
||
8 | { |
||
9 | /** @var \ZipArchive */ |
||
10 | protected $zipFile; |
||
11 | |||
12 | /** @var int */ |
||
13 | protected $fileCount = 0; |
||
14 | |||
15 | /** @var string */ |
||
16 | protected $pathToZip; |
||
17 | |||
18 | /** |
||
19 | * @param string $pathToZip |
||
20 | * @param string|array $files |
||
21 | * |
||
22 | * @return \Spatie\Backup\Tasks\Backup\Zip |
||
23 | */ |
||
24 | public static function create($pathToZip, $files = []) |
||
32 | |||
33 | /** |
||
34 | * @param string $pathToZip |
||
35 | */ |
||
36 | public function __construct($pathToZip) |
||
44 | |||
45 | /** |
||
46 | * @return string |
||
47 | */ |
||
48 | public function getPath() |
||
52 | |||
53 | /** |
||
54 | * @return int |
||
55 | */ |
||
56 | public function getSize() |
||
60 | |||
61 | protected function open() |
||
65 | |||
66 | protected function close() |
||
70 | |||
71 | /** |
||
72 | * @param string|array $files |
||
73 | * @param string $nameInZip |
||
74 | * |
||
75 | * @return \Spatie\Backup\Tasks\Backup\Zip |
||
76 | */ |
||
77 | public function add($files, $nameInZip = null) |
||
98 | |||
99 | public function count() |
||
103 | } |
||
104 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.