1 | <?php |
||
10 | class BackupCommand extends Command |
||
11 | { |
||
12 | /** |
||
13 | * The console command name. |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $name = 'backup:run'; |
||
18 | |||
19 | /** |
||
20 | * The console command description. |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $description = 'Run the backup'; |
||
25 | |||
26 | /** |
||
27 | * Files that will be remove at the end of the command. |
||
28 | * |
||
29 | * @var array |
||
30 | */ |
||
31 | protected $temporaryFiles = []; |
||
32 | |||
33 | /** |
||
34 | * Execute the console command. |
||
35 | * |
||
36 | * @return bool |
||
37 | */ |
||
38 | public function fire() |
||
70 | |||
71 | /** |
||
72 | * Return an array with path to files that should be backed up. |
||
73 | * |
||
74 | * @return array |
||
75 | */ |
||
76 | protected function getAllFilesToBeBackedUp() |
||
96 | |||
97 | /** |
||
98 | * Create a zip for the given files. |
||
99 | * |
||
100 | * @param $files |
||
101 | * |
||
102 | * @return string |
||
103 | */ |
||
104 | protected function createZip($files) |
||
125 | |||
126 | /** |
||
127 | * Copy the given file on the given disk to the given destination. |
||
128 | * |
||
129 | * @param string $file |
||
130 | * @param \Illuminate\Contracts\Filesystem\Filesystem $disk |
||
131 | * @param string $destination |
||
132 | * @param bool $addIgnoreFile |
||
133 | */ |
||
134 | protected function copyFile($file, $disk, $destination, $addIgnoreFile = false) |
||
150 | |||
151 | /** |
||
152 | * Get the filesystems to where the database should be dumped. |
||
153 | * |
||
154 | * @return array |
||
155 | */ |
||
156 | protected function getTargetFileSystems() |
||
166 | |||
167 | /** |
||
168 | * Write an ignore-file on the given disk in the given directory. |
||
169 | * |
||
170 | * @param \Illuminate\Contracts\Filesystem\Filesystem $disk |
||
171 | * @param string $dumpDirectory |
||
172 | */ |
||
173 | protected function writeIgnoreFile($disk, $dumpDirectory) |
||
178 | |||
179 | /** |
||
180 | * Determine the name of the zip that contains the backup. |
||
181 | * |
||
182 | * @return string |
||
183 | */ |
||
184 | protected function getBackupDestinationFileName() |
||
199 | |||
200 | /** |
||
201 | * Get the prefix to be used in the filename of the backup file. |
||
202 | * |
||
203 | * @return string |
||
204 | */ |
||
205 | public function getPrefix() |
||
213 | |||
214 | /** |
||
215 | * Get the suffix to be used in the filename of the backup file. |
||
216 | * |
||
217 | * @return string |
||
218 | */ |
||
219 | public function getSuffix() |
||
227 | |||
228 | /** |
||
229 | * Copy the given file to given filesystem. |
||
230 | * |
||
231 | * @param string $file |
||
232 | * @param $fileSystem |
||
233 | */ |
||
234 | public function copyFileToFileSystem($file, $fileSystem) |
||
246 | |||
247 | /** |
||
248 | * Get the console command options. |
||
249 | * |
||
250 | * @return array |
||
251 | */ |
||
252 | protected function getOptions() |
||
261 | |||
262 | /** |
||
263 | * Get a dump of the db. |
||
264 | * |
||
265 | * @return string |
||
266 | * |
||
267 | * @throws \Exception |
||
268 | */ |
||
269 | protected function getDatabaseDump() |
||
287 | |||
288 | /** |
||
289 | * @throws \Exception |
||
290 | */ |
||
291 | protected function guardAgainstInvalidOptions() |
||
297 | |||
298 | /** |
||
299 | * Remove temporary files |
||
300 | */ |
||
301 | protected function removeTemporaryFiles() |
||
309 | } |
||
310 |
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.