Complex classes like ImportProcessor 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. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
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 ImportProcessor, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 48 | class ImportProcessor implements ImportProcessorInterface |
||
| 49 | { |
||
| 50 | |||
| 51 | /** |
||
| 52 | * A PDO connection initialized with the values from the Doctrine EntityManager. |
||
| 53 | * |
||
| 54 | * @var \PDO |
||
| 55 | */ |
||
| 56 | protected $connection; |
||
| 57 | |||
| 58 | /** |
||
| 59 | * The category assembler instance. |
||
| 60 | * |
||
| 61 | * @var \TechDivision\Import\Assembler\CategoryAssembler |
||
| 62 | */ |
||
| 63 | protected $categoryAssembler; |
||
| 64 | |||
| 65 | /** |
||
| 66 | * The repository to access categories. |
||
| 67 | * |
||
| 68 | * @var \TechDivision\Import\Repositories\CategoryRepository |
||
| 69 | */ |
||
| 70 | protected $categoryRepository; |
||
| 71 | |||
| 72 | /** |
||
| 73 | * The repository to access category varchar values. |
||
| 74 | * |
||
| 75 | * @var \TechDivision\Import\Repositories\CategoryVarcharRepository |
||
| 76 | */ |
||
| 77 | protected $categoryVarcharRepository; |
||
| 78 | |||
| 79 | /** |
||
| 80 | * The repository to access EAV attributes. |
||
| 81 | * |
||
| 82 | * @var \TechDivision\Import\Repositories\EavAttributeRepository |
||
| 83 | */ |
||
| 84 | protected $eavAttributeRepository; |
||
| 85 | |||
| 86 | /** |
||
| 87 | * The repository to access EAV attribute sets. |
||
| 88 | * |
||
| 89 | * @var \TechDivision\Import\Repositories\EavAttributeSetRepository |
||
| 90 | */ |
||
| 91 | protected $eavAttributeSetRepository; |
||
| 92 | |||
| 93 | /** |
||
| 94 | * The repository to access EAV attribute groups. |
||
| 95 | * |
||
| 96 | * @var \TechDivision\Import\Repositories\EavAttributeGroupRepository |
||
| 97 | */ |
||
| 98 | protected $eavAttributeGroupRepository; |
||
| 99 | |||
| 100 | /** |
||
| 101 | * The repository to access EAV entity types. |
||
| 102 | * |
||
| 103 | * @var \TechDivision\Import\Repositories\EavEntityTypeRepository |
||
| 104 | */ |
||
| 105 | protected $eavEntityTypeRepository; |
||
| 106 | |||
| 107 | /** |
||
| 108 | * The repository to access stores. |
||
| 109 | * |
||
| 110 | * @var \TechDivision\Import\Repositories\StoreRepository |
||
| 111 | */ |
||
| 112 | protected $storeRepository; |
||
| 113 | |||
| 114 | /** |
||
| 115 | * The repository to access store websites. |
||
| 116 | * |
||
| 117 | * @var \TechDivision\Import\Repositories\StoreWebsiteRepository |
||
| 118 | */ |
||
| 119 | protected $storeWebsiteRepository; |
||
| 120 | |||
| 121 | /** |
||
| 122 | * The repository to access tax classes. |
||
| 123 | * |
||
| 124 | * @var \TechDivision\Import\Repositories\TaxClassRepository |
||
| 125 | */ |
||
| 126 | protected $taxClassRepository; |
||
| 127 | |||
| 128 | /** |
||
| 129 | * The repository to access link types. |
||
| 130 | * |
||
| 131 | * @var \TechDivision\Import\Repositories\LinkTypeRepository |
||
| 132 | */ |
||
| 133 | protected $linkTypeRepository; |
||
| 134 | |||
| 135 | /** |
||
| 136 | * The repository to access link attributes. |
||
| 137 | * |
||
| 138 | * @var \TechDivision\Import\Repositories\LinkAttributeRepository |
||
| 139 | */ |
||
| 140 | protected $linkAttributeRepository; |
||
| 141 | |||
| 142 | /** |
||
| 143 | * The repository to access the configuration. |
||
| 144 | * |
||
| 145 | * @var \TechDivision\Import\Repositories\CoreConfigDataRepository |
||
| 146 | */ |
||
| 147 | protected $coreConfigDataRepository; |
||
| 148 | |||
| 149 | /** |
||
| 150 | * Initialize the processor with the necessary assembler and repository instances. |
||
| 151 | * |
||
| 152 | * @param \PDO $connection The PDO connection to use |
||
| 153 | * @param \TechDivision\Import\Assembler\CategoryAssembler $categoryAssembler The category assembler instance |
||
| 154 | * @param \TechDivision\Import\Repositories\CategoryRepository $categoryRepository The repository to access categories |
||
| 155 | * @param \TechDivision\Import\Repositories\CategoryVarcharRepository $categoryVarcharRepository The repository to access category varchar values |
||
| 156 | * @param \TechDivision\Import\Repositories\EavAttributeRepository $eavAttributeRepository The repository to access EAV attributes |
||
| 157 | * @param \TechDivision\Import\Repositories\EavAttributeSetRepository $eavAttributeSetRepository The repository to access EAV attribute sets |
||
| 158 | * @param \TechDivision\Import\Repositories\EavAttributeGroupRepository $eavAttributeGroupRepository The repository to access EAV attribute groups |
||
| 159 | * @param \TechDivision\Import\Repositories\EavEntityTypeRepository $eavEntityTypeRepository The repository to access EAV entity types |
||
| 160 | * @param \TechDivision\Import\Repositories\StoreRepository $storeRepository The repository to access stores |
||
| 161 | * @param \TechDivision\Import\Repositories\StoreWebsiteRepository $storeWebsiteRepository The repository to access store websites |
||
| 162 | * @param \TechDivision\Import\Repositories\TaxClassRepository $taxClassRepository The repository to access tax classes |
||
| 163 | * @param \TechDivision\Import\Repositories\LinkTypeRepository $linkTypeRepository The repository to access link types |
||
| 164 | * @param \TechDivision\Import\Repositories\LinkAttributeRepository $linkAttributeRepository The repository to access link attributes |
||
| 165 | * @param \TechDivision\Import\Repositories\CoreConfigDataRepository $coreConfigDataRepository The repository to access the configuration |
||
| 166 | */ |
||
| 167 | public function __construct( |
||
| 198 | |||
| 199 | /** |
||
| 200 | * Set's the passed connection. |
||
| 201 | * |
||
| 202 | * @param \PDO $connection The connection to set |
||
| 203 | * |
||
| 204 | * @return void |
||
| 205 | */ |
||
| 206 | public function setConnection(\PDO $connection) |
||
| 210 | |||
| 211 | /** |
||
| 212 | * Return's the connection. |
||
| 213 | * |
||
| 214 | * @return \PDO The connection instance |
||
| 215 | */ |
||
| 216 | public function getConnection() |
||
| 220 | |||
| 221 | /** |
||
| 222 | * Turns off autocommit mode. While autocommit mode is turned off, changes made to the database via the PDO |
||
| 223 | * object instance are not committed until you end the transaction by calling ProductProcessor::commit(). |
||
| 224 | * Calling ProductProcessor::rollBack() will roll back all changes to the database and return the connection |
||
| 225 | * to autocommit mode. |
||
| 226 | * |
||
| 227 | * @return boolean Returns TRUE on success or FALSE on failure |
||
| 228 | * @link http://php.net/manual/en/pdo.begintransaction.php |
||
| 229 | */ |
||
| 230 | public function beginTransaction() |
||
| 234 | |||
| 235 | /** |
||
| 236 | * Commits a transaction, returning the database connection to autocommit mode until the next call to |
||
| 237 | * ProductProcessor::beginTransaction() starts a new transaction. |
||
| 238 | * |
||
| 239 | * @return boolean Returns TRUE on success or FALSE on failure |
||
| 240 | * @link http://php.net/manual/en/pdo.commit.php |
||
| 241 | */ |
||
| 242 | public function commit() |
||
| 246 | |||
| 247 | /** |
||
| 248 | * Rolls back the current transaction, as initiated by ProductProcessor::beginTransaction(). |
||
| 249 | * |
||
| 250 | * If the database was set to autocommit mode, this function will restore autocommit mode after it has |
||
| 251 | * rolled back the transaction. |
||
| 252 | * |
||
| 253 | * Some databases, including MySQL, automatically issue an implicit COMMIT when a database definition |
||
| 254 | * language (DDL) statement such as DROP TABLE or CREATE TABLE is issued within a transaction. The implicit |
||
| 255 | * COMMIT will prevent you from rolling back any other changes within the transaction boundary. |
||
| 256 | * |
||
| 257 | * @return boolean Returns TRUE on success or FALSE on failure |
||
| 258 | * @link http://php.net/manual/en/pdo.rollback.php |
||
| 259 | */ |
||
| 260 | public function rollBack() |
||
| 264 | |||
| 265 | /** |
||
| 266 | * Set's the category assembler. |
||
| 267 | * |
||
| 268 | * @param \TechDivision\Import\Assembler\CategoryAssembler $categoryAssembler The category assembler |
||
| 269 | * |
||
| 270 | * @return void |
||
| 271 | */ |
||
| 272 | public function setCategoryAssembler($categoryAssembler) |
||
| 276 | |||
| 277 | /** |
||
| 278 | * Return's the category assembler. |
||
| 279 | * |
||
| 280 | * @return \TechDivision\Import\Assembler\CategoryAssembler The category assembler instance |
||
| 281 | */ |
||
| 282 | public function getCategoryAssembler() |
||
| 286 | |||
| 287 | /** |
||
| 288 | * Set's the repository to access categories. |
||
| 289 | * |
||
| 290 | * @param \TechDivision\Import\Repositories\CategoryRepository $categoryRepository The repository to access categories |
||
| 291 | * |
||
| 292 | * @return void |
||
| 293 | */ |
||
| 294 | public function setCategoryRepository($categoryRepository) |
||
| 298 | |||
| 299 | /** |
||
| 300 | * Return's the repository to access categories. |
||
| 301 | * |
||
| 302 | * @return \TechDivision\Import\Repositories\CategoryRepository The repository instance |
||
| 303 | */ |
||
| 304 | public function getCategoryRepository() |
||
| 308 | |||
| 309 | /** |
||
| 310 | * Return's the repository to access category varchar values. |
||
| 311 | * |
||
| 312 | * @param \TechDivision\Import\Repositories\CategoryVarcharRepository $categoryVarcharRepository The repository instance |
||
| 313 | * |
||
| 314 | * @return void |
||
| 315 | */ |
||
| 316 | public function setCategoryVarcharRepository($categoryVarcharRepository) |
||
| 320 | |||
| 321 | /** |
||
| 322 | * Return's the repository to access category varchar values. |
||
| 323 | * |
||
| 324 | * @return \TechDivision\Import\Repositories\CategoryVarcharRepository The repository instance |
||
| 325 | */ |
||
| 326 | public function getCategoryVarcharRepository() |
||
| 330 | |||
| 331 | /** |
||
| 332 | * Set's the repository to access EAV attributes. |
||
| 333 | * |
||
| 334 | * @param \TechDivision\Import\Repositories\EavAttributeRepository $eavAttributeRepository The repository to access EAV attributes |
||
| 335 | * |
||
| 336 | * @return void |
||
| 337 | */ |
||
| 338 | public function setEavAttributeRepository($eavAttributeRepository) |
||
| 342 | |||
| 343 | /** |
||
| 344 | * Return's the repository to access EAV attributes. |
||
| 345 | * |
||
| 346 | * @return \TechDivision\Import\Repositories\EavAttributeRepository The repository instance |
||
| 347 | */ |
||
| 348 | public function getEavAttributeRepository() |
||
| 352 | |||
| 353 | /** |
||
| 354 | * Set's the repository to access EAV attribute sets. |
||
| 355 | * |
||
| 356 | * @param \TechDivision\Import\Repositories\EavAttributeSetRepository $eavAttributeSetRepository The repository the access EAV attribute sets |
||
| 357 | * |
||
| 358 | * @return void |
||
| 359 | */ |
||
| 360 | public function setEavAttributeSetRepository($eavAttributeSetRepository) |
||
| 364 | |||
| 365 | /** |
||
| 366 | * Return's the repository to access EAV attribute sets. |
||
| 367 | * |
||
| 368 | * @return \TechDivision\Import\Repositories\EavAttributeSetRepository The repository instance |
||
| 369 | */ |
||
| 370 | public function getEavAttributeSetRepository() |
||
| 374 | |||
| 375 | /** |
||
| 376 | * Set's the repository to access EAV attribute groups. |
||
| 377 | * |
||
| 378 | * @param \TechDivision\Import\Repositories\EavAttributeGroupRepository $eavAttributeGroupRepository The repository the access EAV attribute groups |
||
| 379 | * |
||
| 380 | * @return void |
||
| 381 | */ |
||
| 382 | public function setEavAttributeGroupRepository($eavAttributeGroupRepository) |
||
| 386 | |||
| 387 | /** |
||
| 388 | * Return's the repository to access EAV attribute groups. |
||
| 389 | * |
||
| 390 | * @return \TechDivision\Import\Repositories\EavAttributeGroupRepository The repository instance |
||
| 391 | */ |
||
| 392 | public function getEavAttributeGroupRepository() |
||
| 396 | |||
| 397 | /** |
||
| 398 | * Return's the repository to access EAV entity types. |
||
| 399 | * |
||
| 400 | * @return \TechDivision\Import\Repositories\EavEntityTypeRepository The repository instance |
||
| 401 | */ |
||
| 402 | public function getEavEntityTypeRepository() |
||
| 406 | |||
| 407 | /** |
||
| 408 | * Set's the repository to access EAV entity types. |
||
| 409 | * |
||
| 410 | * @param \TechDivision\Import\Repositories\EavEntityTypeRepository $eavEntityTypeRepository The repository the access EAV entity types |
||
| 411 | * |
||
| 412 | * @return void |
||
| 413 | */ |
||
| 414 | public function setEavEntityTypeRepository($eavEntityTypeRepository) |
||
| 418 | |||
| 419 | /** |
||
| 420 | * Set's the repository to access stores. |
||
| 421 | * |
||
| 422 | * @param \TechDivision\Import\Repositories\StoreRepository $storeRepository The repository the access stores |
||
| 423 | * |
||
| 424 | * @return void |
||
| 425 | */ |
||
| 426 | public function setStoreRepository($storeRepository) |
||
| 430 | |||
| 431 | /** |
||
| 432 | * Return's the repository to access stores. |
||
| 433 | * |
||
| 434 | * @return \TechDivision\Import\Repositories\StoreRepository The repository instance |
||
| 435 | */ |
||
| 436 | public function getStoreRepository() |
||
| 440 | |||
| 441 | /** |
||
| 442 | * Set's the repository to access store websites. |
||
| 443 | * |
||
| 444 | * @param \TechDivision\Import\Repositories\StoreWebsiteRepository $storeWebsiteRepository The repository the access store websites |
||
| 445 | * |
||
| 446 | * @return void |
||
| 447 | */ |
||
| 448 | public function setStoreWebsiteRepository($storeWebsiteRepository) |
||
| 452 | |||
| 453 | /** |
||
| 454 | * Return's the repository to access store websites. |
||
| 455 | * |
||
| 456 | * @return \TechDivision\Import\Repositories\StoreWebsiteRepository The repository instance |
||
| 457 | */ |
||
| 458 | public function getStoreWebsiteRepository() |
||
| 462 | |||
| 463 | /** |
||
| 464 | * Set's the repository to access tax classes. |
||
| 465 | * |
||
| 466 | * @param \TechDivision\Import\Repositories\TaxClassRepository $taxClassRepository The repository the access stores |
||
| 467 | * |
||
| 468 | * @return void |
||
| 469 | */ |
||
| 470 | public function setTaxClassRepository($taxClassRepository) |
||
| 474 | |||
| 475 | /** |
||
| 476 | * Return's the repository to access tax classes. |
||
| 477 | * |
||
| 478 | * @return \TechDivision\Import\Repositories\TaxClassRepository The repository instance |
||
| 479 | */ |
||
| 480 | public function getTaxClassRepository() |
||
| 484 | |||
| 485 | /** |
||
| 486 | * Set's the repository to access link types. |
||
| 487 | * |
||
| 488 | * @param \TechDivision\Import\Repositories\LinkTypeRepository $linkTypeRepository The repository to access link types |
||
| 489 | * |
||
| 490 | * @return void |
||
| 491 | */ |
||
| 492 | public function setLinkTypeRepository($linkTypeRepository) |
||
| 496 | |||
| 497 | /** |
||
| 498 | * Return's the repository to access link types. |
||
| 499 | * |
||
| 500 | * @return \TechDivision\Import\Repositories\LinkTypeRepository The repository instance |
||
| 501 | */ |
||
| 502 | public function getLinkTypeRepository() |
||
| 506 | |||
| 507 | /** |
||
| 508 | * Set's the repository to access link attributes. |
||
| 509 | * |
||
| 510 | * @param \TechDivision\Import\Repositories\LinkTypeRepository $linkAttributeRepository The repository to access link attributes |
||
| 511 | * |
||
| 512 | * @return void |
||
| 513 | */ |
||
| 514 | public function setLinkAttributeRepository($linkAttributeRepository) |
||
| 518 | |||
| 519 | /** |
||
| 520 | * Return's the repository to access link attributes. |
||
| 521 | * |
||
| 522 | * @return \TechDivision\Import\Repositories\LinkTypeRepository The repository instance |
||
| 523 | */ |
||
| 524 | public function getLinkAttributeRepository() |
||
| 528 | |||
| 529 | /** |
||
| 530 | * Set's the repository to access the Magento 2 configuration. |
||
| 531 | * |
||
| 532 | * @param \TechDivision\Import\Repositories\CoreConfigDataRepository $coreConfigDataRepository The repository to access the Magento 2 configuration |
||
| 533 | * |
||
| 534 | * @return void |
||
| 535 | */ |
||
| 536 | public function setCoreConfigDataRepository($coreConfigDataRepository) |
||
| 540 | |||
| 541 | /** |
||
| 542 | * Return's the repository to access the Magento 2 configuration. |
||
| 543 | * |
||
| 544 | * @return \TechDivision\Import\Repositories\CoreConfigDataRepository The repository instance |
||
| 545 | */ |
||
| 546 | public function getCoreConfigDataRepository() |
||
| 550 | |||
| 551 | /** |
||
| 552 | * Return's the EAV attribute set with the passed ID. |
||
| 553 | * |
||
| 554 | * @param integer $id The ID of the EAV attribute set to load |
||
| 555 | * |
||
| 556 | * @return array The EAV attribute set |
||
| 557 | */ |
||
| 558 | public function getEavAttributeSet($id) |
||
| 562 | |||
| 563 | /** |
||
| 564 | * Return's the attribute sets for the passed entity type ID. |
||
| 565 | * |
||
| 566 | * @param mixed $entityTypeId The entity type ID to return the attribute sets for |
||
| 567 | * |
||
| 568 | * @return array|boolean The attribute sets for the passed entity type ID |
||
| 569 | */ |
||
| 570 | public function getEavAttributeSetsByEntityTypeId($entityTypeId) |
||
| 574 | |||
| 575 | /** |
||
| 576 | * Return's the attribute groups for the passed attribute set ID, whereas the array |
||
| 577 | * is prepared with the attribute group names as keys. |
||
| 578 | * |
||
| 579 | * @param mixed $attributeSetId The EAV attribute set ID to return the attribute groups for |
||
| 580 | * |
||
| 581 | * @return array|boolean The EAV attribute groups for the passed attribute ID |
||
| 582 | */ |
||
| 583 | public function getEavAttributeGroupsByAttributeSetId($attributeSetId) |
||
| 587 | |||
| 588 | /** |
||
| 589 | * Return's an array with the EAV attributes for the passed entity type ID and attribute set name. |
||
| 590 | * |
||
| 591 | * @param integer $entityTypeId The entity type ID of the EAV attributes to return |
||
| 592 | * @param string $attributeSetName The attribute set name of the EAV attributes to return |
||
| 593 | * |
||
| 594 | * @return array The |
||
| 595 | */ |
||
| 596 | public function getEavAttributesByEntityTypeIdAndAttributeSetName($entityTypeId, $attributeSetName) |
||
| 600 | |||
| 601 | /** |
||
| 602 | * Return's an array with the available EAV attributes for the passed option value and store ID. |
||
| 603 | * |
||
| 604 | * @param string $optionValue The option value of the EAV attributes |
||
| 605 | * @param string $storeId The store ID of the EAV attribues |
||
| 606 | * |
||
| 607 | * @return array The array with all available EAV attributes |
||
| 608 | */ |
||
| 609 | public function getEavAttributesByOptionValueAndStoreId($optionValue, $storeId) |
||
| 613 | |||
| 614 | /** |
||
| 615 | * Return's the first EAV attribute for the passed option value and store ID. |
||
| 616 | * |
||
| 617 | * @param string $optionValue The option value of the EAV attributes |
||
| 618 | * @param string $storeId The store ID of the EAV attribues |
||
| 619 | * |
||
| 620 | * @return array The array with the EAV attribute |
||
| 621 | */ |
||
| 622 | public function getEavAttributeByOptionValueAndStoreId($optionValue, $storeId) |
||
| 626 | |||
| 627 | /** |
||
| 628 | * Return's an array with the available EAV attributes for the passed is user defined flag. |
||
| 629 | * |
||
| 630 | * @param integer $isUserDefined The flag itself |
||
| 631 | * |
||
| 632 | * @return array The array with the EAV attributes matching the passed flag |
||
| 633 | */ |
||
| 634 | public function getEavAttributesByIsUserDefined($isUserDefined = 1) |
||
| 638 | |||
| 639 | /** |
||
| 640 | * Return's an array with the available EAV attributes for the passed is entity type and |
||
| 641 | * user defined flag. |
||
| 642 | * |
||
| 643 | * @param integer $entityTypeId The entity type ID of the EAV attributes to return |
||
| 644 | * @param integer $isUserDefined The flag itself |
||
| 645 | * |
||
| 646 | * @return array The array with the EAV attributes matching the passed entity type and user defined flag |
||
| 647 | */ |
||
| 648 | public function getEavAttributesByEntityTypeIdAndIsUserDefined($entityTypeId, $isUserDefined = 1) |
||
| 652 | |||
| 653 | /** |
||
| 654 | * Return's an array with all available EAV entity types with the entity type code as key. |
||
| 655 | * |
||
| 656 | * @return array The available link types |
||
| 657 | */ |
||
| 658 | public function getEavEntityTypes() |
||
| 662 | |||
| 663 | /** |
||
| 664 | * Return's an array with the available stores. |
||
| 665 | * |
||
| 666 | * @return array The array with the available stores |
||
| 667 | */ |
||
| 668 | public function getStores() |
||
| 672 | |||
| 673 | /** |
||
| 674 | * Return's the default store. |
||
| 675 | * |
||
| 676 | * @return array The default store |
||
| 677 | */ |
||
| 678 | public function getDefaultStore() |
||
| 682 | |||
| 683 | /** |
||
| 684 | * Return's an array with the available store websites. |
||
| 685 | * |
||
| 686 | * @return array The array with the available store websites |
||
| 687 | */ |
||
| 688 | public function getStoreWebsites() |
||
| 692 | |||
| 693 | /** |
||
| 694 | * Return's an array with the available tax classes. |
||
| 695 | * |
||
| 696 | * @return array The array with the available tax classes |
||
| 697 | */ |
||
| 698 | public function getTaxClasses() |
||
| 702 | |||
| 703 | /** |
||
| 704 | * Return's an array with all available categories. |
||
| 705 | * |
||
| 706 | * @return array The available categories |
||
| 707 | */ |
||
| 708 | public function getCategories() |
||
| 712 | |||
| 713 | /** |
||
| 714 | * Return's an array with the root categories with the store code as key. |
||
| 715 | * |
||
| 716 | * @return array The root categories |
||
| 717 | */ |
||
| 718 | public function getRootCategories() |
||
| 722 | |||
| 723 | /** |
||
| 724 | * Returns the category varchar values for the categories with |
||
| 725 | * the passed with the passed entity IDs. |
||
| 726 | * |
||
| 727 | * @param array $entityIds The array with the category IDs |
||
| 728 | * |
||
| 729 | * @return mixed The category varchar values |
||
| 730 | */ |
||
| 731 | public function getCategoryVarcharsByEntityIds(array $entityIds) |
||
| 735 | |||
| 736 | /** |
||
| 737 | * Return's an array with all available link types. |
||
| 738 | * |
||
| 739 | * @return array The available link types |
||
| 740 | */ |
||
| 741 | public function getLinkTypes() |
||
| 745 | |||
| 746 | /** |
||
| 747 | * Return's an array with all available link attributes. |
||
| 748 | * |
||
| 749 | * @return array The available link attributes |
||
| 750 | */ |
||
| 751 | public function getLinkAttributes() |
||
| 755 | |||
| 756 | /** |
||
| 757 | * Return's an array with the Magento 2 configuration. |
||
| 758 | * |
||
| 759 | * @return array The Magento 2 configuration |
||
| 760 | */ |
||
| 761 | public function getCoreConfigData() |
||
| 765 | |||
| 766 | /** |
||
| 767 | * Returns the array with the global data necessary for the |
||
| 768 | * import process. |
||
| 769 | * |
||
| 770 | * @return array The array with the global data |
||
| 771 | */ |
||
| 772 | public function getGlobalData() |
||
| 838 | } |
||
| 839 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: