| Total Complexity | 112 |
| Total Lines | 704 |
| Duplicated Lines | 0 % |
| Changes | 14 | ||
| Bugs | 1 | Features | 1 |
Complex classes like ExcelImportExport often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use ExcelImportExport, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 30 | class ExcelImportExport |
||
| 31 | { |
||
| 32 | use Configurable; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Setting this to false improve performance but may lead to skipped cells |
||
| 36 | * @var bool |
||
| 37 | */ |
||
| 38 | public static $iterate_only_existing_cells = false; |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Useful if importing only one sheet or if computation fails |
||
| 42 | * @var bool |
||
| 43 | */ |
||
| 44 | public static $use_old_calculated_value = false; |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Some excel sheets need extra processing |
||
| 48 | * @var boolean |
||
| 49 | */ |
||
| 50 | public static $process_headers = false; |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @var string |
||
| 54 | */ |
||
| 55 | public static $default_tmp_reader = 'Xlsx'; |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @var integer |
||
| 59 | */ |
||
| 60 | public static $limit_exports = 1000; |
||
| 61 | |||
| 62 | /** |
||
| 63 | * You can override the static var with yml config if needed |
||
| 64 | * @return int |
||
| 65 | */ |
||
| 66 | public static function getExportLimit() |
||
| 67 | { |
||
| 68 | $v = self::config()->export_limit; |
||
| 69 | if ($v) { |
||
| 70 | return $v; |
||
| 71 | } |
||
| 72 | return self::$limit_exports; |
||
| 73 | } |
||
| 74 | |||
| 75 | /** |
||
| 76 | * Get all db fields for a given dataobject class |
||
| 77 | * |
||
| 78 | * @param string $class |
||
| 79 | * @return array<string,string> |
||
| 80 | */ |
||
| 81 | public static function allFieldsForClass($class) |
||
| 82 | { |
||
| 83 | $dataClasses = ClassInfo::dataClassesFor($class); |
||
| 84 | $fields = []; |
||
| 85 | $dataObjectSchema = DataObject::getSchema(); |
||
| 86 | foreach ($dataClasses as $dataClass) { |
||
| 87 | $dataFields = $dataObjectSchema->databaseFields($dataClass); |
||
| 88 | $fields = array_merge($fields, array_keys($dataFields)); |
||
| 89 | } |
||
| 90 | return array_combine($fields, $fields); |
||
| 91 | } |
||
| 92 | |||
| 93 | /** |
||
| 94 | * Get fields that should be exported by default for a class |
||
| 95 | * |
||
| 96 | * @param string $class |
||
| 97 | * @return array<int|string,mixed> |
||
| 98 | */ |
||
| 99 | public static function exportFieldsForClass($class) |
||
| 126 | } |
||
| 127 | |||
| 128 | /** |
||
| 129 | * Get fields that can be imported by default for a class |
||
| 130 | * |
||
| 131 | * @param string $class |
||
| 132 | * @return array<string,string> |
||
| 133 | */ |
||
| 134 | public static function importFieldsForClass($class) |
||
| 152 | } |
||
| 153 | |||
| 154 | public static function createDownloadSampleLink($importer = '') |
||
| 165 | } |
||
| 166 | |||
| 167 | public static function createSampleFile($data, $fileName) |
||
| 168 | { |
||
| 169 | $ext = self::getDefaultExtension(); |
||
| 170 | $fileNameExtension = pathinfo($fileName, PATHINFO_EXTENSION); |
||
| 171 | if (!$fileNameExtension) { |
||
| 172 | $fileName .= ".$ext"; |
||
| 173 | } |
||
| 174 | $options = new Options(); |
||
| 175 | $options->creator = ExcelImportExport::config()->default_creator; |
||
| 176 | SpreadCompat::output($data, $fileName, $options); |
||
| 177 | exit(); |
||
| 178 | } |
||
| 179 | |||
| 180 | /** |
||
| 181 | * Output a sample file for a class |
||
| 182 | * |
||
| 183 | * A custom file can be provided with a custom sampleExcelFile method |
||
| 184 | * either as a file path or as a Excel instance |
||
| 185 | * |
||
| 186 | * @param string $class |
||
| 187 | * @return void |
||
| 188 | */ |
||
| 189 | public static function sampleFileForClass($class) |
||
| 190 | { |
||
| 191 | $ext = self::getDefaultExtension(); |
||
| 192 | $filter = new FileNameFilter(); |
||
| 193 | $fileName = $filter->filter("sample-file-for-$class.$ext"); |
||
| 194 | $spreadsheet = null; |
||
| 195 | |||
| 196 | $sng = singleton($class); |
||
| 197 | |||
| 198 | // Deprecated |
||
| 199 | if ($sng->hasMethod('sampleExcelFile')) { |
||
| 200 | $spreadsheet = $sng->sampleExcelFile(); |
||
| 201 | // PHPSpreadsheet is required for this |
||
| 202 | $writer = self::getDefaultWriter($spreadsheet); |
||
| 203 | self::outputHeaders($fileName); |
||
| 204 | $writer->save('php://output'); |
||
| 205 | exit(); |
||
| 206 | } |
||
| 207 | |||
| 208 | if ($sng->hasMethod('sampleImportData')) { |
||
| 209 | $data = $sng->sampleImportData(); |
||
| 210 | } else { |
||
| 211 | // Simply output the default headers |
||
| 212 | $data = [ExcelImportExport::importFieldsForClass($class)]; |
||
| 213 | } |
||
| 214 | |||
| 215 | if (!is_iterable($data)) { |
||
| 216 | throw new Exception("`sampleImportData` must return an iterable"); |
||
| 217 | } |
||
| 218 | |||
| 219 | self::createSampleFile($data, $fileName); |
||
| 220 | } |
||
| 221 | |||
| 222 | /** |
||
| 223 | * @param \SilverStripe\Admin\ModelAdmin $controller |
||
| 224 | * @return bool |
||
| 225 | */ |
||
| 226 | public static function checkImportForm($controller) |
||
| 240 | } |
||
| 241 | |||
| 242 | /** |
||
| 243 | * This can be used in your ModelAdmin class |
||
| 244 | * |
||
| 245 | * public function import(array $data, Form $form): HTTPResponse |
||
| 246 | * { |
||
| 247 | * if (!ExcelImportExport::checkImportForm($this)) { |
||
| 248 | * throw new Exception("Invalid import form"); |
||
| 249 | * } |
||
| 250 | * $handler = $data['ImportHandler'] ?? null; |
||
| 251 | * if ($handler == "default") { |
||
| 252 | * return parent::import($data, $form); |
||
| 253 | * } |
||
| 254 | * return ExcelImportExport::useCustomHandler($handler, $form, $this); |
||
| 255 | * } |
||
| 256 | * |
||
| 257 | * @param class-string $handler |
||
| 258 | * @param Form $form |
||
| 259 | * @param Controller $controller |
||
| 260 | * @return HTTPResponse |
||
| 261 | */ |
||
| 262 | public static function useCustomHandler($handler, Form $form, Controller $controller) |
||
| 263 | { |
||
| 264 | // Check if the class has a ::load method |
||
| 265 | if (!$handler || !method_exists($handler, "load")) { |
||
| 266 | $form->sessionMessage("Invalid handler: $handler", 'bad'); |
||
| 267 | return $controller->redirectBack(); |
||
| 268 | } |
||
| 269 | $file = $_FILES['_CsvFile']['tmp_name']; |
||
| 270 | $name = $_FILES['_CsvFile']['name']; |
||
| 271 | |||
| 272 | // Handler could be any class with a ::load method or an instance of BulkLoader |
||
| 273 | $modelClass = method_exists($handler, 'getModelClass') ? $controller->getModelClass() : null; |
||
| 274 | $inst = new $handler($modelClass); |
||
| 275 | |||
| 276 | if (!empty($_POST['OnlyUpdateRecords']) && method_exists($inst, 'setOnlyUpdate')) { |
||
| 277 | $inst->setOnlyUpdate(true); |
||
| 278 | } |
||
| 279 | /** @var ExcelLoaderInterface $inst */ |
||
| 280 | try { |
||
| 281 | $results = $inst->load($file, $name); |
||
| 282 | } catch (Exception $e) { |
||
| 283 | $form->sessionMessage($e->getMessage(), 'bad'); |
||
| 284 | return $controller->redirectBack(); |
||
| 285 | } |
||
| 286 | |||
| 287 | $message = ''; |
||
| 288 | if ($results instanceof BulkLoader_Result) { |
||
| 289 | if ($results->CreatedCount()) { |
||
| 290 | $message .= _t( |
||
| 291 | 'ModelAdmin.IMPORTEDRECORDS', |
||
| 292 | "Imported {count} records.", |
||
| 293 | ['count' => $results->CreatedCount()] |
||
| 294 | ); |
||
| 295 | } |
||
| 296 | if ($results->UpdatedCount()) { |
||
| 297 | $message .= _t( |
||
| 298 | 'ModelAdmin.UPDATEDRECORDS', |
||
| 299 | "Updated {count} records.", |
||
| 300 | ['count' => $results->UpdatedCount()] |
||
| 301 | ); |
||
| 302 | } |
||
| 303 | if ($results->DeletedCount()) { |
||
| 304 | $message .= _t( |
||
| 305 | 'ModelAdmin.DELETEDRECORDS', |
||
| 306 | "Deleted {count} records.", |
||
| 307 | ['count' => $results->DeletedCount()] |
||
| 308 | ); |
||
| 309 | } |
||
| 310 | if (!$results->CreatedCount() && !$results->UpdatedCount()) { |
||
| 311 | $message .= _t('ModelAdmin.NOIMPORT', "Nothing to import"); |
||
| 312 | } |
||
| 313 | } else { |
||
| 314 | // Or we have a simple result |
||
| 315 | $message = $results; |
||
| 316 | } |
||
| 317 | |||
| 318 | $form->sessionMessage($message, 'good'); |
||
| 319 | return $controller->redirectBack(); |
||
| 320 | } |
||
| 321 | |||
| 322 | /** |
||
| 323 | * @return string |
||
| 324 | */ |
||
| 325 | public static function getDefaultExtension() |
||
| 326 | { |
||
| 327 | return self::config()->default_extension ?? 'xlsx'; |
||
| 328 | } |
||
| 329 | |||
| 330 | /** |
||
| 331 | * Get default writer for PHPSpreadsheet if installed |
||
| 332 | * |
||
| 333 | * @param Spreadsheet $spreadsheet |
||
| 334 | * @return IWriter |
||
| 335 | */ |
||
| 336 | public static function getDefaultWriter(Spreadsheet $spreadsheet): IWriter |
||
| 337 | { |
||
| 338 | if (!self::isPhpSpreadsheetAvailable()) { |
||
| 339 | throw new Exception("PHPSpreadsheet is not installed"); |
||
| 340 | } |
||
| 341 | $writer = ucfirst(self::getDefaultExtension()); |
||
| 342 | return IOFactory::createWriter($spreadsheet, $writer); |
||
| 343 | } |
||
| 344 | |||
| 345 | /** |
||
| 346 | * Get default reader for PHPSpreadsheet if installed |
||
| 347 | * |
||
| 348 | * @return IReader |
||
| 349 | */ |
||
| 350 | public static function getDefaultReader(): IReader |
||
| 351 | { |
||
| 352 | if (!self::isPhpSpreadsheetAvailable()) { |
||
| 353 | throw new Exception("PHPSpreadsheet is not installed"); |
||
| 354 | } |
||
| 355 | $writer = ucfirst(self::getDefaultExtension()); |
||
| 356 | return IOFactory::createReader($writer); |
||
| 357 | } |
||
| 358 | |||
| 359 | /** |
||
| 360 | * Output excel headers |
||
| 361 | * |
||
| 362 | * @param string $fileName |
||
| 363 | * @return void |
||
| 364 | */ |
||
| 365 | public static function outputHeaders($fileName) |
||
| 366 | { |
||
| 367 | $ext = pathinfo($fileName, PATHINFO_EXTENSION); |
||
| 368 | switch ($ext) { |
||
| 369 | case 'csv': |
||
| 370 | header('Content-Type: text/csv'); |
||
| 371 | break; |
||
| 372 | case 'xlsx': |
||
| 373 | header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); |
||
| 374 | break; |
||
| 375 | default: |
||
| 376 | header('Content-type: application/vnd.ms-excel'); |
||
| 377 | break; |
||
| 378 | } |
||
| 379 | |||
| 380 | header('Content-Disposition: attachment; filename="' . $fileName . '"'); |
||
| 381 | header('Cache-Control: max-age=0'); |
||
| 382 | ob_clean(); |
||
| 383 | } |
||
| 384 | |||
| 385 | /** |
||
| 386 | * Generate a default import file with all field name |
||
| 387 | * @deprecated |
||
| 388 | * @param string $class |
||
| 389 | * @return string |
||
| 390 | */ |
||
| 391 | public static function generateDefaultSampleFile($class) |
||
| 392 | { |
||
| 393 | $opts = [ |
||
| 394 | 'creator' => "SilverStripe" |
||
| 395 | ]; |
||
| 396 | $allFields = ExcelImportExport::importFieldsForClass($class); |
||
| 397 | $tmpname = SpreadCompat::getTempFilename(); |
||
| 398 | SpreadCompat::write([ |
||
| 399 | $allFields |
||
| 400 | ], $tmpname, ...$opts); |
||
| 401 | return $tmpname; |
||
| 402 | } |
||
| 403 | |||
| 404 | /** |
||
| 405 | * Show valid extensions helper (for uploaders) |
||
| 406 | * |
||
| 407 | * @return string |
||
| 408 | */ |
||
| 409 | public static function getValidExtensionsText() |
||
| 410 | { |
||
| 411 | return _t( |
||
| 412 | 'ExcelImportExport.VALIDEXTENSIONS', |
||
| 413 | "Allowed extensions: {extensions}", |
||
| 414 | array('extensions' => implode(', ', self::getValidExtensions())) |
||
| 415 | ); |
||
| 416 | } |
||
| 417 | |||
| 418 | /** |
||
| 419 | * Extracted from PHPSpreadsheet |
||
| 420 | * |
||
| 421 | * @param string $ext |
||
| 422 | * @return string |
||
| 423 | */ |
||
| 424 | public static function getReaderForExtension($ext) |
||
| 425 | { |
||
| 426 | switch (strtolower($ext)) { |
||
| 427 | case 'xlsx': // Excel (OfficeOpenXML) Spreadsheet |
||
| 428 | case 'xlsm': // Excel (OfficeOpenXML) Macro Spreadsheet (macros will be discarded) |
||
| 429 | case 'xltx': // Excel (OfficeOpenXML) Template |
||
| 430 | case 'xltm': // Excel (OfficeOpenXML) Macro Template (macros will be discarded) |
||
| 431 | return 'Xlsx'; |
||
| 432 | case 'xls': // Excel (BIFF) Spreadsheet |
||
| 433 | case 'xlt': // Excel (BIFF) Template |
||
| 434 | return 'Xls'; |
||
| 435 | case 'ods': // Open/Libre Offic Calc |
||
| 436 | case 'ots': // Open/Libre Offic Calc Template |
||
| 437 | return 'Ods'; |
||
| 438 | case 'slk': |
||
| 439 | return 'Slk'; |
||
| 440 | case 'xml': // Excel 2003 SpreadSheetML |
||
| 441 | return 'Xml'; |
||
| 442 | case 'gnumeric': |
||
| 443 | return 'Gnumeric'; |
||
| 444 | case 'htm': |
||
| 445 | case 'html': |
||
| 446 | return 'Html'; |
||
| 447 | case 'csv': |
||
| 448 | return 'Csv'; |
||
| 449 | case 'tmp': // Useful when importing uploaded files |
||
| 450 | return self::$default_tmp_reader; |
||
| 451 | default: |
||
| 452 | throw new Exception("Unsupported file type : $ext"); |
||
| 453 | } |
||
| 454 | } |
||
| 455 | |||
| 456 | /** |
||
| 457 | * @return boolean |
||
| 458 | */ |
||
| 459 | public static function isPhpSpreadsheetAvailable() |
||
| 462 | } |
||
| 463 | |||
| 464 | /** |
||
| 465 | * If you exported separated files, you can merge them in one big file |
||
| 466 | * Requires PHPSpreadsheet |
||
| 467 | * @param array<string> $files |
||
| 468 | * @return Spreadsheet |
||
| 469 | */ |
||
| 470 | public static function mergeExcelFiles($files) |
||
| 471 | { |
||
| 472 | if (!self::isPhpSpreadsheetAvailable()) { |
||
| 473 | throw new Exception("PHPSpreadsheet is not installed"); |
||
| 474 | } |
||
| 475 | $merged = new Spreadsheet; |
||
| 476 | $merged->removeSheetByIndex(0); |
||
| 477 | foreach ($files as $filename) { |
||
| 478 | $remoteExcel = IOFactory::load($filename); |
||
| 479 | $merged->addExternalSheet($remoteExcel->getActiveSheet()); |
||
| 480 | } |
||
| 481 | return $merged; |
||
| 482 | } |
||
| 483 | |||
| 484 | /** |
||
| 485 | * Get valid extensions |
||
| 486 | * |
||
| 487 | * @return array<string> |
||
| 488 | */ |
||
| 489 | public static function getValidExtensions() |
||
| 490 | { |
||
| 491 | $v = self::config()->allowed_extensions; |
||
| 492 | if (!$v || !is_array($v)) { |
||
| 493 | return []; |
||
| 494 | } |
||
| 495 | return $v; |
||
| 496 | } |
||
| 497 | |||
| 498 | /** |
||
| 499 | * Save content of an array to a file |
||
| 500 | * |
||
| 501 | * @param iterable<array<mixed>> $data |
||
| 502 | * @param string $filepath |
||
| 503 | * @return void |
||
| 504 | */ |
||
| 505 | public static function arrayToFile($data, $filepath) |
||
| 506 | { |
||
| 507 | SpreadCompat::write($data, $filepath); |
||
| 508 | } |
||
| 509 | |||
| 510 | /** |
||
| 511 | * Fast saving to csv |
||
| 512 | * |
||
| 513 | * @param array<mixed> $data |
||
| 514 | * @param string $filepath |
||
| 515 | * @param string $delimiter |
||
| 516 | * @param string $enclosure |
||
| 517 | * @param string $escapeChar |
||
| 518 | * @return void |
||
| 519 | */ |
||
| 520 | public static function arrayToCsv($data, $filepath, $delimiter = ',', $enclosure = '"', $escapeChar = '\\') |
||
| 521 | { |
||
| 522 | if (is_file($filepath)) { |
||
| 523 | unlink($filepath); |
||
| 524 | } |
||
| 525 | $options = new Options(); |
||
| 526 | $options->separator = $delimiter; |
||
| 527 | $options->enclosure = $enclosure; |
||
| 528 | $options->escape = $escapeChar; |
||
| 529 | SpreadCompat::write($data, $filepath, $options); |
||
| 530 | } |
||
| 531 | |||
| 532 | public static function excelColumnRange(string $lower = 'A', string $upper = 'ZZ'): Generator |
||
| 533 | { |
||
| 534 | ++$upper; |
||
| 535 | for ($i = $lower; $i !== $upper; ++$i) { |
||
| 536 | yield $i; |
||
| 537 | } |
||
| 538 | } |
||
| 539 | |||
| 540 | /** |
||
| 541 | * String from column index. |
||
| 542 | * |
||
| 543 | * @param int $index Column index (1 = A) |
||
| 544 | * @param string $fallback |
||
| 545 | * @return string |
||
| 546 | */ |
||
| 547 | public static function getLetter($index, $fallback = 'A') |
||
| 556 | } |
||
| 557 | |||
| 558 | /** |
||
| 559 | * Convert a file to an array |
||
| 560 | * |
||
| 561 | * @param string $filepath |
||
| 562 | * @param string $delimiter (csv only) |
||
| 563 | * @param string $enclosure (csv only) |
||
| 564 | * @param string $ext if extension cannot be deducted from filepath (eg temp files) |
||
| 565 | * @return array<mixed> |
||
| 566 | */ |
||
| 567 | public static function fileToArray($filepath, $delimiter = ';', $enclosure = '', $ext = null) |
||
| 582 | } |
||
| 583 | |||
| 584 | /** |
||
| 585 | * Convert an excel file to an array |
||
| 586 | * |
||
| 587 | * @param string $filepath |
||
| 588 | * @param string $sheetname Load a specific worksheet by name |
||
| 589 | * @param bool $onlyExisting Avoid reading empty columns |
||
| 590 | * @param string $ext if extension cannot be deducted from filepath (eg temp files) |
||
| 591 | * @return array<mixed> |
||
| 592 | */ |
||
| 593 | public static function excelToArray($filepath, $sheetname = null, $onlyExisting = true, $ext = null) |
||
| 594 | { |
||
| 595 | if (!self::isPhpSpreadsheetAvailable()) { |
||
| 596 | throw new Exception("PHPSpreadsheet is not installed"); |
||
| 597 | } |
||
| 598 | if ($ext === null) { |
||
| 599 | $ext = pathinfo($filepath, PATHINFO_EXTENSION); |
||
| 600 | } |
||
| 601 | $ext = pathinfo($filepath, PATHINFO_EXTENSION); |
||
| 602 | $readerType = self::getReaderForExtension($ext); |
||
| 603 | $reader = IOFactory::createReader($readerType); |
||
| 604 | $reader->setReadDataOnly(true); |
||
| 605 | if ($sheetname) { |
||
| 606 | $reader->setLoadSheetsOnly($sheetname); |
||
| 607 | } |
||
| 608 | $data = []; |
||
| 609 | if ($reader->canRead($filepath)) { |
||
| 610 | $excel = $reader->load($filepath); |
||
| 611 | if ($onlyExisting) { |
||
| 612 | $data = []; |
||
| 613 | foreach ($excel->getActiveSheet()->getRowIterator() as $row) { |
||
| 614 | $cellIterator = $row->getCellIterator(); |
||
| 615 | if (self::$iterate_only_existing_cells) { |
||
| 616 | $cellIterator->setIterateOnlyExistingCells(true); |
||
| 617 | } |
||
| 618 | $cells = []; |
||
| 619 | foreach ($cellIterator as $cell) { |
||
| 620 | if (self::$use_old_calculated_value) { |
||
| 621 | $cells[] = $cell->getOldCalculatedValue(); |
||
| 622 | } else { |
||
| 623 | $cells[] = $cell->getFormattedValue(); |
||
| 624 | } |
||
| 625 | } |
||
| 626 | $data[] = $cells; |
||
| 627 | } |
||
| 628 | } else { |
||
| 629 | $data = $excel->getActiveSheet()->toArray(null, true, false, false); |
||
| 630 | } |
||
| 631 | } else { |
||
| 632 | throw new Exception("Cannot read $filepath"); |
||
| 633 | } |
||
| 634 | return $data; |
||
| 635 | } |
||
| 636 | |||
| 637 | /** |
||
| 638 | * @link https://stackoverflow.com/questions/44304795/how-to-retrieve-date-from-table-cell-using-phpspreadsheet#44304796 |
||
| 639 | * @param int|string|null|float $v |
||
| 640 | * @return string |
||
| 641 | */ |
||
| 642 | public static function convertExcelDate($v) |
||
| 654 | } |
||
| 655 | |||
| 656 | /** |
||
| 657 | * Convert an excel file to an associative array |
||
| 658 | * |
||
| 659 | * Suppose the first line are the headers of the file |
||
| 660 | * Headers are trimmed in case you have crappy whitespace in your files |
||
| 661 | * |
||
| 662 | * @param string $filepath |
||
| 663 | * @param string $sheetname Load a specific worksheet by name |
||
| 664 | * @param string $ext if extension cannot be deducted from filepath (eg temp files) |
||
| 665 | * @return array<mixed> |
||
| 666 | */ |
||
| 667 | public static function excelToAssocArray($filepath, $sheetname = null, $ext = null) |
||
| 734 | } |
||
| 735 | } |
||
| 736 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths