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 | ||
| 55 | class ImportProcessor implements ImportProcessorInterface | ||
| 56 | { | ||
| 57 | |||
| 58 | /** | ||
| 59 | * A connection to use. | ||
| 60 | * | ||
| 61 | * @var \TechDivision\Import\Connection\ConnectionInterface | ||
| 62 | */ | ||
| 63 | protected $connection; | ||
| 64 | |||
| 65 | /** | ||
| 66 | * The category assembler instance. | ||
| 67 | * | ||
| 68 | * @var \TechDivision\Import\Assembler\CategoryAssemblerInterface | ||
| 69 | */ | ||
| 70 | protected $categoryAssembler; | ||
| 71 | |||
| 72 | /** | ||
| 73 | * The repository to access categories. | ||
| 74 | * | ||
| 75 | * @var \TechDivision\Import\Repositories\CategoryRepository | ||
| 76 | */ | ||
| 77 | protected $categoryRepository; | ||
| 78 | |||
| 79 | /** | ||
| 80 | * The repository to access category varchar values. | ||
| 81 | * | ||
| 82 | * @var \TechDivision\Import\Repositories\CategoryVarcharRepositoryInterface | ||
| 83 | */ | ||
| 84 | protected $categoryVarcharRepository; | ||
| 85 | |||
| 86 | /** | ||
| 87 | * The repository to access EAV attributes. | ||
| 88 | * | ||
| 89 | * @var \TechDivision\Import\Repositories\EavAttributeRepositoryInterface | ||
| 90 | */ | ||
| 91 | protected $eavAttributeRepository; | ||
| 92 | |||
| 93 | /** | ||
| 94 | * The repository to access EAV attribute sets. | ||
| 95 | * | ||
| 96 | * @var \TechDivision\Import\Repositories\EavAttributeSetRepositoryInterface | ||
| 97 | */ | ||
| 98 | protected $eavAttributeSetRepository; | ||
| 99 | |||
| 100 | /** | ||
| 101 | * The repository to access EAV attribute groups. | ||
| 102 | * | ||
| 103 | * @var \TechDivision\Import\Repositories\EavAttributeGroupRepositoryInterface | ||
| 104 | */ | ||
| 105 | protected $eavAttributeGroupRepository; | ||
| 106 | |||
| 107 | /** | ||
| 108 | * The repository to access EAV attribute groups. | ||
| 109 | * | ||
| 110 | * @var \TechDivision\Import\Repositories\EavAttributeOptionValueRepositoryInterface | ||
| 111 | */ | ||
| 112 | protected $eavAttributeOptionValueRepository; | ||
| 113 | |||
| 114 | /** | ||
| 115 | * The repository to access EAV entity types. | ||
| 116 | * | ||
| 117 | * @var \TechDivision\Import\Repositories\EavEntityTypeRepositoryInterface | ||
| 118 | */ | ||
| 119 | protected $eavEntityTypeRepository; | ||
| 120 | |||
| 121 | /** | ||
| 122 | * The repository to access stores. | ||
| 123 | * | ||
| 124 | * @var \TechDivision\Import\Repositories\StoreRepositoryInterface | ||
| 125 | */ | ||
| 126 | protected $storeRepository; | ||
| 127 | |||
| 128 | /** | ||
| 129 | * The repository to access store websites. | ||
| 130 | * | ||
| 131 | * @var \TechDivision\Import\Repositories\StoreWebsiteRepositoryInterface | ||
| 132 | */ | ||
| 133 | protected $storeWebsiteRepository; | ||
| 134 | |||
| 135 | /** | ||
| 136 | * The repository to access tax classes. | ||
| 137 | * | ||
| 138 | * @var \TechDivision\Import\Repositories\TaxClassRepositoryInterface | ||
| 139 | */ | ||
| 140 | protected $taxClassRepository; | ||
| 141 | |||
| 142 | /** | ||
| 143 | * The repository to access link types. | ||
| 144 | * | ||
| 145 | * @var \TechDivision\Import\Repositories\LinkTypeRepositoryInterface | ||
| 146 | */ | ||
| 147 | protected $linkTypeRepository; | ||
| 148 | |||
| 149 | /** | ||
| 150 | * The repository to access image types. | ||
| 151 | * | ||
| 152 | * @var \TechDivision\Import\Repositories\ImageTypeRepositoryInterface | ||
| 153 | */ | ||
| 154 | protected $imageTypeRepository; | ||
| 155 | |||
| 156 | /** | ||
| 157 | * The repository to access link attributes. | ||
| 158 | * | ||
| 159 | * @var \TechDivision\Import\Repositories\LinkAttributeRepositoryInterface | ||
| 160 | */ | ||
| 161 | protected $linkAttributeRepository; | ||
| 162 | |||
| 163 | /** | ||
| 164 | * The repository to access the configuration. | ||
| 165 | * | ||
| 166 | * @var \TechDivision\Import\Repositories\CoreConfigDataRepositoryInterface | ||
| 167 | */ | ||
| 168 | protected $coreConfigDataRepository; | ||
| 169 | |||
| 170 | /** | ||
| 171 | * The repository to access the customer groups. | ||
| 172 | * | ||
| 173 | * @var \TechDivision\Import\Repositories\CustomerGroupRepositoryInterface | ||
| 174 | */ | ||
| 175 | protected $customerGroupRepository; | ||
| 176 | |||
| 177 | /** | ||
| 178 | * The repository to access the admin user. | ||
| 179 | * | ||
| 180 | * @var \TechDivision\Import\Repositories\AdminUserRepositoryInterface | ||
| 181 | */ | ||
| 182 | protected $adminUserRepository; | ||
| 183 | |||
| 184 | /** | ||
| 185 | * The repository to access the URL rewrites. | ||
| 186 | * | ||
| 187 | * @var \TechDivision\Import\Repositories\UrlRewriteRepositoryInterface | ||
| 188 | */ | ||
| 189 | protected $urlRewriteRepository; | ||
| 190 | |||
| 191 | /** | ||
| 192 | * The action for store CRUD methods. | ||
| 193 | * | ||
| 194 | * @var \TechDivision\Import\Actions\ActionInterface | ||
| 195 | */ | ||
| 196 | protected $storeAction; | ||
| 197 | |||
| 198 | /** | ||
| 199 | * The action for store group CRUD methods. | ||
| 200 | * | ||
| 201 | * @var \TechDivision\Import\Actions\ActionInterface | ||
| 202 | */ | ||
| 203 | protected $storeGroupAction; | ||
| 204 | |||
| 205 | /** | ||
| 206 | * The action for store website CRUD methods. | ||
| 207 | * | ||
| 208 | * @var \TechDivision\Import\Actions\ActionInterface | ||
| 209 | */ | ||
| 210 | protected $storeWebsiteAction; | ||
| 211 | |||
| 212 | /** | ||
| 213 | * The action for import history CRUD methods. | ||
| 214 | * | ||
| 215 | * @var \TechDivision\Import\Actions\ActionInterface | ||
| 216 | */ | ||
| 217 | protected $importHistoryAction; | ||
| 218 | |||
| 219 | /** | ||
| 220 | * Initialize the processor with the necessary assembler and repository instances. | ||
| 221 | * | ||
| 222 | * @param \TechDivision\Import\Connection\ConnectionInterface $connection The connection to use | ||
| 223 | * @param \TechDivision\Import\Assembler\CategoryAssemblerInterface $categoryAssembler The category assembler instance | ||
| 224 | * @param \TechDivision\Import\Repositories\CategoryRepositoryInterface $categoryRepository The repository to access categories | ||
| 225 | * @param \TechDivision\Import\Repositories\CategoryVarcharRepositoryInterface $categoryVarcharRepository The repository to access category varchar values | ||
| 226 | * @param \TechDivision\Import\Repositories\EavAttributeRepositoryInterface $eavAttributeRepository The repository to access EAV attributes | ||
| 227 | * @param \TechDivision\Import\Repositories\EavAttributeSetRepositoryInterface $eavAttributeSetRepository The repository to access EAV attribute sets | ||
| 228 | * @param \TechDivision\Import\Repositories\EavAttributeGroupRepositoryInterface $eavAttributeGroupRepository The repository to access EAV attribute groups | ||
| 229 | * @param \TechDivision\Import\Repositories\EavAttributeOptionValueRepositoryInterface $eavAttributeOptionValueRepository The repository to access EAV attribute option value repository | ||
| 230 | * @param \TechDivision\Import\Repositories\EavEntityTypeRepositoryInterface $eavEntityTypeRepository The repository to access EAV entity types | ||
| 231 | * @param \TechDivision\Import\Repositories\StoreRepositoryInterface $storeRepository The repository to access stores | ||
| 232 | * @param \TechDivision\Import\Repositories\StoreWebsiteRepositoryInterface $storeWebsiteRepository The repository to access store websites | ||
| 233 | * @param \TechDivision\Import\Repositories\TaxClassRepositoryInterface $taxClassRepository The repository to access tax classes | ||
| 234 | * @param \TechDivision\Import\Repositories\LinkTypeRepositoryInterface $linkTypeRepository The repository to access link types | ||
| 235 | * @param \TechDivision\Import\Repositories\LinkAttributeRepositoryInterface $linkAttributeRepository The repository to access link attributes | ||
| 236 | * @param \TechDivision\Import\Repositories\CoreConfigDataRepositoryInterface $coreConfigDataRepository The repository to access the configuration | ||
| 237 | * @param \TechDivision\Import\Repositories\CustomerGroupRepositoryInterface $customerGroupRepository The repository to access the customer groups | ||
| 238 | * @param \TechDivision\Import\Repositories\ImageTypeRepositoryInterface $imageTypeRepository The repository to access images types | ||
| 239 | * @param \TechDivision\Import\Repositories\AdminUserRepositoryInterface $adminUserRepository The repository to access admin users | ||
| 240 | * @param \TechDivision\Import\Repositories\UrlRewriteRepositoryInterface $urlRewriteRepository The repository to access URL rewrites | ||
| 241 | * @param \TechDivision\Import\Actions\ActionInterface $storeAction The action with the store CRUD methods | ||
| 242 | * @param \TechDivision\Import\Actions\ActionInterface $storeGroupAction The action with the store group CRUD methods | ||
| 243 | * @param \TechDivision\Import\Actions\ActionInterface $storeWebsiteAction The action with the store website CRUD methods | ||
| 244 | * @param \TechDivision\Import\Actions\ActionInterface $importHistoryAction The action with the import history CRUD methods | ||
| 245 | */ | ||
| 246 | public function __construct( | ||
| 295 | |||
| 296 | /** | ||
| 297 | * Set's the passed connection. | ||
| 298 | * | ||
| 299 | * @param \TechDivision\Import\Connection\ConnectionInterface $connection The connection to set | ||
| 300 | * | ||
| 301 | * @return void | ||
| 302 | */ | ||
| 303 | public function setConnection(ConnectionInterface $connection) | ||
| 307 | |||
| 308 | /** | ||
| 309 | * Return's the connection. | ||
| 310 | * | ||
| 311 | * @return \TechDivision\Import\Connection\ConnectionInterface The connection instance | ||
| 312 | */ | ||
| 313 | public function getConnection() | ||
| 317 | |||
| 318 | /** | ||
| 319 | * Turns off autocommit mode. While autocommit mode is turned off, changes made to the database via the PDO | ||
| 320 | * object instance are not committed until you end the transaction by calling ProductProcessor::commit(). | ||
| 321 | * Calling ProductProcessor::rollBack() will roll back all changes to the database and return the connection | ||
| 322 | * to autocommit mode. | ||
| 323 | * | ||
| 324 | * @return boolean Returns TRUE on success or FALSE on failure | ||
| 325 | * @link http://php.net/manual/en/pdo.begintransaction.php | ||
| 326 | */ | ||
| 327 | public function beginTransaction() | ||
| 331 | |||
| 332 | /** | ||
| 333 | * Commits a transaction, returning the database connection to autocommit mode until the next call to | ||
| 334 | * ProductProcessor::beginTransaction() starts a new transaction. | ||
| 335 | * | ||
| 336 | * @return boolean Returns TRUE on success or FALSE on failure | ||
| 337 | * @link http://php.net/manual/en/pdo.commit.php | ||
| 338 | */ | ||
| 339 | public function commit() | ||
| 343 | |||
| 344 | /** | ||
| 345 | * Rolls back the current transaction, as initiated by ProductProcessor::beginTransaction(). | ||
| 346 | * | ||
| 347 | * If the database was set to autocommit mode, this function will restore autocommit mode after it has | ||
| 348 | * rolled back the transaction. | ||
| 349 | * | ||
| 350 | * Some databases, including MySQL, automatically issue an implicit COMMIT when a database definition | ||
| 351 | * language (DDL) statement such as DROP TABLE or CREATE TABLE is issued within a transaction. The implicit | ||
| 352 | * COMMIT will prevent you from rolling back any other changes within the transaction boundary. | ||
| 353 | * | ||
| 354 | * @return boolean Returns TRUE on success or FALSE on failure | ||
| 355 | * @link http://php.net/manual/en/pdo.rollback.php | ||
| 356 | */ | ||
| 357 | public function rollBack() | ||
| 361 | |||
| 362 | /** | ||
| 363 | * Set's the category assembler. | ||
| 364 | * | ||
| 365 | * @param \TechDivision\Import\Assembler\CategoryAssemblerInterface $categoryAssembler The category assembler | ||
| 366 | * | ||
| 367 | * @return void | ||
| 368 | */ | ||
| 369 | public function setCategoryAssembler($categoryAssembler) | ||
| 373 | |||
| 374 | /** | ||
| 375 | * Return's the category assembler. | ||
| 376 | * | ||
| 377 | * @return \TechDivision\Import\Assembler\CategoryAssemblerInterface The category assembler instance | ||
| 378 | */ | ||
| 379 | public function getCategoryAssembler() | ||
| 383 | |||
| 384 | /** | ||
| 385 | * Set's the repository to access categories. | ||
| 386 | * | ||
| 387 | * @param \TechDivision\Import\Repositories\CategoryRepositoryInterface $categoryRepository The repository to access categories | ||
| 388 | * | ||
| 389 | * @return void | ||
| 390 | */ | ||
| 391 | public function setCategoryRepository(CategoryRepositoryInterface $categoryRepository) | ||
| 395 | |||
| 396 | /** | ||
| 397 | * Return's the repository to access categories. | ||
| 398 | * | ||
| 399 | * @return \TechDivision\Import\Repositories\CategoryRepositoryInterface The repository instance | ||
| 400 | */ | ||
| 401 | public function getCategoryRepository() | ||
| 405 | |||
| 406 | /** | ||
| 407 | * Return's the repository to access category varchar values. | ||
| 408 | * | ||
| 409 | * @param \TechDivision\Import\Repositories\CategoryVarcharRepositoryInterface $categoryVarcharRepository The repository instance | ||
| 410 | * | ||
| 411 | * @return void | ||
| 412 | */ | ||
| 413 | public function setCategoryVarcharRepository(CategoryVarcharRepositoryInterface $categoryVarcharRepository) | ||
| 417 | |||
| 418 | /** | ||
| 419 | * Return's the repository to access category varchar values. | ||
| 420 | * | ||
| 421 | * @return \TechDivision\Import\Repositories\CategoryVarcharRepositoryInterface The repository instance | ||
| 422 | */ | ||
| 423 | public function getCategoryVarcharRepository() | ||
| 427 | |||
| 428 | /** | ||
| 429 | * Set's the repository to access EAV attributes. | ||
| 430 | * | ||
| 431 | * @param \TechDivision\Import\Repositories\EavAttributeRepositoryInterface $eavAttributeRepository The repository to access EAV attributes | ||
| 432 | * | ||
| 433 | * @return void | ||
| 434 | */ | ||
| 435 | public function setEavAttributeRepository(EavAttributeRepositoryInterface $eavAttributeRepository) | ||
| 439 | |||
| 440 | /** | ||
| 441 | * Return's the repository to access EAV attributes. | ||
| 442 | * | ||
| 443 | * @return \TechDivision\Import\Repositories\EavAttributeRepositoryInterface The repository instance | ||
| 444 | */ | ||
| 445 | public function getEavAttributeRepository() | ||
| 449 | |||
| 450 | /** | ||
| 451 | * Set's the repository to access EAV attribute sets. | ||
| 452 | * | ||
| 453 | * @param \TechDivision\Import\Repositories\EavAttributeSetRepositoryInterface $eavAttributeSetRepository The repository the access EAV attribute sets | ||
| 454 | * | ||
| 455 | * @return void | ||
| 456 | */ | ||
| 457 | public function setEavAttributeSetRepository(EavAttributeSetRepositoryInterface $eavAttributeSetRepository) | ||
| 461 | |||
| 462 | /** | ||
| 463 | * Return's the repository to access EAV attribute sets. | ||
| 464 | * | ||
| 465 | * @return \TechDivision\Import\Repositories\EavAttributeSetRepositoryInterface The repository instance | ||
| 466 | */ | ||
| 467 | public function getEavAttributeSetRepository() | ||
| 471 | |||
| 472 | /** | ||
| 473 | * Set's the repository to access EAV attribute groups. | ||
| 474 | * | ||
| 475 | * @param \TechDivision\Import\Repositories\EavAttributeGroupRepositoryInterface $eavAttributeGroupRepository The repository the access EAV attribute groups | ||
| 476 | * | ||
| 477 | * @return void | ||
| 478 | */ | ||
| 479 | public function setEavAttributeGroupRepository(EavAttributeGroupRepositoryInterface $eavAttributeGroupRepository) | ||
| 483 | |||
| 484 | /** | ||
| 485 | * Return's the repository to access EAV attribute groups. | ||
| 486 | * | ||
| 487 | * @return \TechDivision\Import\Repositories\EavAttributeGroupRepositoryInterface The repository instance | ||
| 488 | */ | ||
| 489 | public function getEavAttributeGroupRepository() | ||
| 493 | |||
| 494 | /** | ||
| 495 | * Set's the repository to access EAV attribute option values. | ||
| 496 | * | ||
| 497 | * @param \TechDivision\Import\Repositories\EavAttributeOptionValueRepositoryInterface $eavAttributeOptionValueRepository The repository the access EAV attribute option values | ||
| 498 | * | ||
| 499 | * @return void | ||
| 500 | */ | ||
| 501 | public function setEavAttributeOptionValueRepository(EavAttributeOptionValueRepositoryInterface $eavAttributeOptionValueRepository) | ||
| 505 | |||
| 506 | /** | ||
| 507 | * Return's the repository to access EAV attribute option values. | ||
| 508 | * | ||
| 509 | * @return \TechDivision\Import\Repositories\EavAttributeOptionValueRepositoryInterface The repository instance | ||
| 510 | */ | ||
| 511 | public function getEavAttributeOptionValueRepository() | ||
| 515 | |||
| 516 | /** | ||
| 517 | * Return's the repository to access EAV entity types. | ||
| 518 | * | ||
| 519 | * @return \TechDivision\Import\Repositories\EavEntityTypeRepositoryInterface The repository instance | ||
| 520 | */ | ||
| 521 | public function getEavEntityTypeRepository() | ||
| 525 | |||
| 526 | /** | ||
| 527 | * Set's the repository to access EAV entity types. | ||
| 528 | * | ||
| 529 | * @param \TechDivision\Import\Repositories\EavEntityTypeRepositoryInterface $eavEntityTypeRepository The repository the access EAV entity types | ||
| 530 | * | ||
| 531 | * @return void | ||
| 532 | */ | ||
| 533 | public function setEavEntityTypeRepository(EavEntityTypeRepositoryInterface $eavEntityTypeRepository) | ||
| 537 | |||
| 538 | /** | ||
| 539 | * Set's the repository to access stores. | ||
| 540 | * | ||
| 541 | * @param \TechDivision\Import\Repositories\StoreRepositoryInterface $storeRepository The repository the access stores | ||
| 542 | * | ||
| 543 | * @return void | ||
| 544 | */ | ||
| 545 | public function setStoreRepository(StoreRepositoryInterface $storeRepository) | ||
| 549 | |||
| 550 | /** | ||
| 551 | * Return's the repository to access stores. | ||
| 552 | * | ||
| 553 | * @return \TechDivision\Import\Repositories\StoreRepositoryInterface The repository instance | ||
| 554 | */ | ||
| 555 | public function getStoreRepository() | ||
| 559 | |||
| 560 | /** | ||
| 561 | * Set's the repository to access store websites. | ||
| 562 | * | ||
| 563 | * @param \TechDivision\Import\Repositories\StoreWebsiteRepositoryInterface $storeWebsiteRepository The repository the access store websites | ||
| 564 | * | ||
| 565 | * @return void | ||
| 566 | */ | ||
| 567 | public function setStoreWebsiteRepository(StoreWebsiteRepositoryInterface $storeWebsiteRepository) | ||
| 571 | |||
| 572 | /** | ||
| 573 | * Return's the repository to access store websites. | ||
| 574 | * | ||
| 575 | * @return \TechDivision\Import\Repositories\StoreWebsiteRepositoryInterface The repository instance | ||
| 576 | */ | ||
| 577 | public function getStoreWebsiteRepository() | ||
| 581 | |||
| 582 | /** | ||
| 583 | * Set's the repository to access tax classes. | ||
| 584 | * | ||
| 585 | * @param \TechDivision\Import\Repositories\TaxClassRepositoryInterface $taxClassRepository The repository the access stores | ||
| 586 | * | ||
| 587 | * @return void | ||
| 588 | */ | ||
| 589 | public function setTaxClassRepository(TaxClassRepositoryInterface $taxClassRepository) | ||
| 593 | |||
| 594 | /** | ||
| 595 | * Return's the repository to access tax classes. | ||
| 596 | * | ||
| 597 | * @return \TechDivision\Import\Repositories\TaxClassRepositoryInterface The repository instance | ||
| 598 | */ | ||
| 599 | public function getTaxClassRepository() | ||
| 603 | |||
| 604 | /** | ||
| 605 | * Set's the repository to access link types. | ||
| 606 | * | ||
| 607 | * @param \TechDivision\Import\Repositories\LinkTypeRepositoryInterface $linkTypeRepository The repository to access link types | ||
| 608 | * | ||
| 609 | * @return void | ||
| 610 | */ | ||
| 611 | public function setLinkTypeRepository(LinkTypeRepositoryInterface $linkTypeRepository) | ||
| 615 | |||
| 616 | /** | ||
| 617 | * Return's the repository to access link types. | ||
| 618 | * | ||
| 619 | * @return \TechDivision\Import\Repositories\LinkTypeRepositoryInterface The repository instance | ||
| 620 | */ | ||
| 621 | public function getLinkTypeRepository() | ||
| 625 | |||
| 626 | /** | ||
| 627 | * Set's the repository to access link attributes. | ||
| 628 | * | ||
| 629 | * @param \TechDivision\Import\Repositories\LinkAttributeRepositoryInterface $linkAttributeRepository The repository to access link attributes | ||
| 630 | * | ||
| 631 | * @return void | ||
| 632 | */ | ||
| 633 | public function setLinkAttributeRepository(LinkAttributeRepositoryInterface $linkAttributeRepository) | ||
| 637 | |||
| 638 | /** | ||
| 639 | * Return's the repository to access link attributes. | ||
| 640 | * | ||
| 641 | * @return \TechDivision\Import\Repositories\LinkAttributeRepositoryInterface The repository instance | ||
| 642 | */ | ||
| 643 | public function getLinkAttributeRepository() | ||
| 647 | |||
| 648 | /** | ||
| 649 | * Set's the repository to access link types. | ||
| 650 | * | ||
| 651 | * @param \TechDivision\Import\Repositories\ImageTypeRepositoryInterface $imageTypeRepository The repository to access image types | ||
| 652 | * | ||
| 653 | * @return void | ||
| 654 | */ | ||
| 655 | public function setImageTypeRepository(ImageTypeRepositoryInterface $imageTypeRepository) | ||
| 659 | |||
| 660 | /** | ||
| 661 | * Return's the repository to access link types. | ||
| 662 | * | ||
| 663 | * @return \TechDivision\Import\Repositories\ImageTypeRepositoryInterface The repository instance | ||
| 664 | */ | ||
| 665 | public function getImageTypeRepository() | ||
| 669 | |||
| 670 | /** | ||
| 671 | * Set's the repository to access the Magento 2 configuration. | ||
| 672 | * | ||
| 673 | * @param \TechDivision\Import\Repositories\CoreConfigDataRepositoryInterface $coreConfigDataRepository The repository to access the Magento 2 configuration | ||
| 674 | * | ||
| 675 | * @return void | ||
| 676 | */ | ||
| 677 | public function setCoreConfigDataRepository(CoreConfigDataRepositoryInterface $coreConfigDataRepository) | ||
| 681 | |||
| 682 | /** | ||
| 683 | * Return's the repository to access the Magento 2 configuration. | ||
| 684 | * | ||
| 685 | * @return \TechDivision\Import\Repositories\CoreConfigDataRepositoryInterface The repository instance | ||
| 686 | */ | ||
| 687 | public function getCoreConfigDataRepository() | ||
| 691 | |||
| 692 | /** | ||
| 693 | * Set's the repository to access the customer groups. | ||
| 694 | * | ||
| 695 | * @param \TechDivision\Import\Repositories\CustomerGroupRepositoryInterface $customerGroupRepository The repository to access the customer groups | ||
| 696 | * | ||
| 697 | * @return void | ||
| 698 | */ | ||
| 699 | public function setCustomerGroupRepository(CustomerGroupRepositoryInterface $customerGroupRepository) | ||
| 703 | |||
| 704 | /** | ||
| 705 | * Return's the repository to access the customer groups. | ||
| 706 | * | ||
| 707 | * @return \TechDivision\Import\Repositories\CustomerGroupRepositoryInterface The repository instance | ||
| 708 | */ | ||
| 709 | public function getCustomerGroupRepository() | ||
| 713 | |||
| 714 | /** | ||
| 715 | * Set's the repository to access the admin users. | ||
| 716 | * | ||
| 717 | * @param \TechDivision\Import\Repositories\AdminUserRepositoryInterface $adminUserRepository The repository to access the admin users | ||
| 718 | * | ||
| 719 | * @return void | ||
| 720 | */ | ||
| 721 | public function setAdminUserRepository(AdminUserRepositoryInterface $adminUserRepository) | ||
| 725 | |||
| 726 | /** | ||
| 727 | * Return's the repository to access the admin users. | ||
| 728 | * | ||
| 729 | * @return \TechDivision\Import\Repositories\AdminUserRepositoryInterface The repository instance | ||
| 730 | */ | ||
| 731 | public function getAdminUserRepository() | ||
| 735 | |||
| 736 | /** | ||
| 737 | * Set's the repository to access the URL rewrites. | ||
| 738 | * | ||
| 739 | * @param \TechDivision\Import\Repositories\UrlRewriteRepositoryInterface $urlRewriteRepository The repository to access the URL rewrites | ||
| 740 | * | ||
| 741 | * @return void | ||
| 742 | */ | ||
| 743 | public function setUrlRewriteRepository(UrlRewriteRepositoryInterface $urlRewriteRepository) | ||
| 747 | |||
| 748 | /** | ||
| 749 | * Return's the repository to access the URL rewrites. | ||
| 750 | * | ||
| 751 | * @return \TechDivision\Import\Repositories\UrlRewriteRepositoryInterface The repository instance | ||
| 752 | */ | ||
| 753 | public function getUrlRewriteRepository() | ||
| 757 | |||
| 758 | /** | ||
| 759 | * Set's the action with the store CRUD methods. | ||
| 760 | * | ||
| 761 | * @param \TechDivision\Import\Actions\ActionInterface $storeAction The action with the store CRUD methods | ||
| 762 | * | ||
| 763 | * @return void | ||
| 764 | */ | ||
| 765 | public function setStoreAction(ActionInterface $storeAction) | ||
| 769 | |||
| 770 | /** | ||
| 771 | * Return's the action with the store CRUD methods. | ||
| 772 | * | ||
| 773 | * @return \TechDivision\Import\Actions\ActionInterface The action instance | ||
| 774 | */ | ||
| 775 | public function getStoreAction() | ||
| 779 | |||
| 780 | /** | ||
| 781 | * Set's the action with the store group CRUD methods. | ||
| 782 | * | ||
| 783 | * @param \TechDivision\Import\Actions\ActionInterface $storeGroupAction The action with the store group CRUD methods | ||
| 784 | * | ||
| 785 | * @return void | ||
| 786 | */ | ||
| 787 | public function setStoreGroupAction(ActionInterface $storeGroupAction) | ||
| 791 | |||
| 792 | /** | ||
| 793 | * Return's the action with the store group CRUD methods. | ||
| 794 | * | ||
| 795 | * @return \TechDivision\Import\Actions\ActionInterface The action instance | ||
| 796 | */ | ||
| 797 | public function getStoreGroupAction() | ||
| 801 | |||
| 802 | /** | ||
| 803 | * Set's the action with the store website CRUD methods. | ||
| 804 | * | ||
| 805 | * @param \TechDivision\Import\Actions\ActionInterface $storeWebsiteAction The action with the store website CRUD methods | ||
| 806 | * | ||
| 807 | * @return void | ||
| 808 | */ | ||
| 809 | public function setStoreWebsiteAction(ActionInterface $storeWebsiteAction) | ||
| 813 | |||
| 814 | /** | ||
| 815 | * Return's the action with the store website CRUD methods. | ||
| 816 | * | ||
| 817 | * @return \TechDivision\Import\Actions\ActionInterface The action instance | ||
| 818 | */ | ||
| 819 | public function getStoreWebsiteAction() | ||
| 823 | |||
| 824 | /** | ||
| 825 | * Set's the action with the import history CRUD methods. | ||
| 826 | * | ||
| 827 | * @param \TechDivision\Import\Actions\ActionInterface $importHistoryAction The action with the import history CRUD methods | ||
| 828 | * | ||
| 829 | * @return void | ||
| 830 | */ | ||
| 831 | public function setImportHistoryAction(ActionInterface $importHistoryAction) | ||
| 835 | |||
| 836 | /** | ||
| 837 | * Return's the action with the import history CRUD methods. | ||
| 838 | * | ||
| 839 | * @return \TechDivision\Import\Actions\ActionInterface The action instance | ||
| 840 | */ | ||
| 841 | public function getImportHistoryAction() | ||
| 845 | |||
| 846 | /** | ||
| 847 | * Return's the EAV attribute set with the passed ID. | ||
| 848 | * | ||
| 849 | * @param integer $id The ID of the EAV attribute set to load | ||
| 850 | * | ||
| 851 | * @return array The EAV attribute set | ||
| 852 | */ | ||
| 853 | public function getEavAttributeSet($id) | ||
| 857 | |||
| 858 | /** | ||
| 859 | * Return's the attribute sets for the passed entity type ID. | ||
| 860 | * | ||
| 861 | * @param mixed $entityTypeId The entity type ID to return the attribute sets for | ||
| 862 | * | ||
| 863 | * @return array|boolean The attribute sets for the passed entity type ID | ||
| 864 | */ | ||
| 865 | public function getEavAttributeSetsByEntityTypeId($entityTypeId) | ||
| 869 | |||
| 870 | /** | ||
| 871 | * Return's the attribute groups for the passed attribute set ID, whereas the array | ||
| 872 | * is prepared with the attribute group names as keys. | ||
| 873 | * | ||
| 874 | * @param mixed $attributeSetId The EAV attribute set ID to return the attribute groups for | ||
| 875 | * | ||
| 876 | * @return array|boolean The EAV attribute groups for the passed attribute ID | ||
| 877 | */ | ||
| 878 | public function getEavAttributeGroupsByAttributeSetId($attributeSetId) | ||
| 882 | |||
| 883 | /** | ||
| 884 | * Load's and return's the available EAV attribute option values by the passed entity type and store ID. | ||
| 885 | * | ||
| 886 | * @param integer $entityTypeId The entity type ID of the attribute option values to return | ||
| 887 | * @param integer $storeId The store ID of the attribute option values to return | ||
| 888 | * | ||
| 889 | * @return array The EAV attribute option values | ||
| 890 | */ | ||
| 891 | public function getEavAttributeOptionValuesByEntityTypeIdAndStoreId($entityTypeId, $storeId) | ||
| 895 | |||
| 896 | /** | ||
| 897 | * Return's an array with the EAV attributes for the passed entity type ID and attribute set name. | ||
| 898 | * | ||
| 899 | * @param integer $entityTypeId The entity type ID of the EAV attributes to return | ||
| 900 | * @param string $attributeSetName The attribute set name of the EAV attributes to return | ||
| 901 | * | ||
| 902 | * @return array The | ||
| 903 | */ | ||
| 904 | public function getEavAttributesByEntityTypeIdAndAttributeSetName($entityTypeId, $attributeSetName) | ||
| 908 | |||
| 909 | /** | ||
| 910 | * Return's an array with the available EAV attributes for the passed option value and store ID. | ||
| 911 | * | ||
| 912 | * @param string $optionValue The option value of the EAV attributes | ||
| 913 | * @param string $storeId The store ID of the EAV attribues | ||
| 914 | * | ||
| 915 | * @return array The array with all available EAV attributes | ||
| 916 | */ | ||
| 917 | public function getEavAttributesByOptionValueAndStoreId($optionValue, $storeId) | ||
| 921 | |||
| 922 | /** | ||
| 923 | * Return's the first EAV attribute for the passed option value and store ID. | ||
| 924 | * | ||
| 925 | * @param string $optionValue The option value of the EAV attributes | ||
| 926 | * @param string $storeId The store ID of the EAV attribues | ||
| 927 | * | ||
| 928 | * @return array The array with the EAV attribute | ||
| 929 | */ | ||
| 930 | public function getEavAttributeByOptionValueAndStoreId($optionValue, $storeId) | ||
| 934 | |||
| 935 | /** | ||
| 936 | * Return's an array with the available EAV attributes for the passed is user defined flag. | ||
| 937 | * | ||
| 938 | * @param integer $isUserDefined The flag itself | ||
| 939 | * | ||
| 940 | * @return array The array with the EAV attributes matching the passed flag | ||
| 941 | */ | ||
| 942 | public function getEavAttributesByIsUserDefined($isUserDefined = 1) | ||
| 946 | |||
| 947 | /** | ||
| 948 | * Return's an array with the available EAV attributes for the passed is entity type and | ||
| 949 | * user defined flag. | ||
| 950 | * | ||
| 951 | * @param integer $entityTypeId The entity type ID of the EAV attributes to return | ||
| 952 | * @param integer $isUserDefined The flag itself | ||
| 953 | * | ||
| 954 | * @return array The array with the EAV attributes matching the passed entity type and user defined flag | ||
| 955 | */ | ||
| 956 | public function getEavAttributesByEntityTypeIdAndIsUserDefined($entityTypeId, $isUserDefined = 1) | ||
| 960 | |||
| 961 | /** | ||
| 962 | * Return's an array with the availabe EAV attributes for the passed entity type. | ||
| 963 | * | ||
| 964 | * @param integer $entityTypeId The entity type ID of the EAV attributes to return | ||
| 965 | * | ||
| 966 | * @return array The array with the EAV attributes matching the passed entity type | ||
| 967 | */ | ||
| 968 | public function getEavAttributesByEntityTypeId($entityTypeId) | ||
| 972 | |||
| 973 | /** | ||
| 974 | * Return's the EAV attribute with the passed entity type ID and code. | ||
| 975 | * | ||
| 976 | * @param integer $entityTypeId The entity type ID of the EAV attribute to return | ||
| 977 | * @param string $attributeCode The code of the EAV attribute to return | ||
| 978 | * | ||
| 979 | * @return array The EAV attribute | ||
| 980 | */ | ||
| 981 | public function getEavAttributeByEntityTypeIdAndAttributeCode($entityTypeId, $attributeCode) | ||
| 985 | |||
| 986 | /** | ||
| 987 | * Return's an EAV entity type with the passed entity type code. | ||
| 988 | * | ||
| 989 | * @param string $entityTypeCode The code of the entity type to return | ||
| 990 | * | ||
| 991 | * @return array The entity type with the passed entity type code | ||
| 992 | */ | ||
| 993 | public function getEavEntityTypeByEntityTypeCode($entityTypeCode) | ||
| 997 | |||
| 998 | /** | ||
| 999 | * Return's an array with all available EAV entity types with the entity type code as key. | ||
| 1000 | * | ||
| 1001 | * @return array The available link types | ||
| 1002 | */ | ||
| 1003 | public function getEavEntityTypes() | ||
| 1007 | |||
| 1008 | /** | ||
| 1009 | * Return's an array with the available stores. | ||
| 1010 | * | ||
| 1011 | * @return array The array with the available stores | ||
| 1012 | */ | ||
| 1013 | public function getStores() | ||
| 1017 | |||
| 1018 | /** | ||
| 1019 | * Return's the default store. | ||
| 1020 | * | ||
| 1021 | * @return array The default store | ||
| 1022 | */ | ||
| 1023 | public function getDefaultStore() | ||
| 1027 | |||
| 1028 | /** | ||
| 1029 | * Return's an array with the available store websites. | ||
| 1030 | * | ||
| 1031 | * @return array The array with the available store websites | ||
| 1032 | */ | ||
| 1033 | public function getStoreWebsites() | ||
| 1037 | |||
| 1038 | /** | ||
| 1039 | * Return's an array with the available tax classes. | ||
| 1040 | * | ||
| 1041 | * @return array The array with the available tax classes | ||
| 1042 | */ | ||
| 1043 | public function getTaxClasses() | ||
| 1047 | |||
| 1048 | /** | ||
| 1049 | * Return's an array with all available categories. | ||
| 1050 | * | ||
| 1051 | * @return array The available categories | ||
| 1052 | */ | ||
| 1053 | public function getCategories() | ||
| 1057 | |||
| 1058 | /** | ||
| 1059 | * Return's an array with the root categories with the store code as key. | ||
| 1060 | * | ||
| 1061 | * @return array The root categories | ||
| 1062 | */ | ||
| 1063 | public function getRootCategories() | ||
| 1067 | |||
| 1068 | /** | ||
| 1069 | * Returns the category varchar values for the categories with | ||
| 1070 | * the passed with the passed entity IDs. | ||
| 1071 | * | ||
| 1072 | * @param array $entityIds The array with the category IDs | ||
| 1073 | * | ||
| 1074 | * @return mixed The category varchar values | ||
| 1075 | */ | ||
| 1076 | public function getCategoryVarcharsByEntityIds(array $entityIds) | ||
| 1080 | |||
| 1081 | /** | ||
| 1082 | * Return's an array with all available link types. | ||
| 1083 | * | ||
| 1084 | * @return array The available link types | ||
| 1085 | */ | ||
| 1086 | public function getLinkTypes() | ||
| 1090 | |||
| 1091 | /** | ||
| 1092 | * Return's an array with all available link attributes. | ||
| 1093 | * | ||
| 1094 | * @return array The available link attributes | ||
| 1095 | */ | ||
| 1096 | public function getLinkAttributes() | ||
| 1100 | |||
| 1101 | /** | ||
| 1102 | * Return's an array with all available image types. | ||
| 1103 | * | ||
| 1104 | * @return array The available image types | ||
| 1105 | */ | ||
| 1106 | public function getImageTypes() | ||
| 1110 | |||
| 1111 | /** | ||
| 1112 | * Return's an array with the Magento 2 configuration. | ||
| 1113 | * | ||
| 1114 | * @return array The Magento 2 configuration | ||
| 1115 | */ | ||
| 1116 | public function getCoreConfigData() | ||
| 1120 | |||
| 1121 | /** | ||
| 1122 | * Returns the customer groups. | ||
| 1123 | * | ||
| 1124 | * @return array The customer groups | ||
| 1125 | */ | ||
| 1126 | public function getCustomerGroups() | ||
| 1130 | |||
| 1131 | /** | ||
| 1132 | * Return's an array with all available admin users. | ||
| 1133 | * | ||
| 1134 | * @return array The available admin users | ||
| 1135 | */ | ||
| 1136 | public function getAdminUsers() | ||
| 1140 | |||
| 1141 | /** | ||
| 1142 | * Load's and return's the admin user with the passed username. | ||
| 1143 | * | ||
| 1144 | * @param string $username The username of the admin user to return | ||
| 1145 | * | ||
| 1146 | * @return array|null The admin user with the passed username | ||
| 1147 | */ | ||
| 1148 | public function getAdminUserByUsername($username) | ||
| 1152 | |||
| 1153 | /** | ||
| 1154 | * Persist's the passed store. | ||
| 1155 | * | ||
| 1156 | * @param array $store The store to persist | ||
| 1157 | * | ||
| 1158 | * @return void | ||
| 1159 | */ | ||
| 1160 | public function persistStore(array $store) | ||
| 1164 | |||
| 1165 | /** | ||
| 1166 | * Persist's the passed store group. | ||
| 1167 | * | ||
| 1168 | * @param array $storeGroup The store group to persist | ||
| 1169 | * | ||
| 1170 | * @return void | ||
| 1171 | */ | ||
| 1172 | public function persistStoreGroup(array $storeGroup) | ||
| 1176 | |||
| 1177 | /** | ||
| 1178 | * Persist's the passed store website. | ||
| 1179 | * | ||
| 1180 | * @param array $storeWebsite The store website to persist | ||
| 1181 | * | ||
| 1182 | * @return void | ||
| 1183 | */ | ||
| 1184 | public function persistStoreWebsite(array $storeWebsite) | ||
| 1188 | |||
| 1189 | /** | ||
| 1190 | * Persist's the passed import history. | ||
| 1191 | * | ||
| 1192 | * @param array $importHistory The import history to persist | ||
| 1193 | * | ||
| 1194 | * @return void | ||
| 1195 | */ | ||
| 1196 | public function persistImportHistory(array $importHistory) | ||
| 1200 | |||
| 1201 | /** | ||
| 1202 | * Returns the array with the global data necessary for the | ||
| 1203 | * import process. | ||
| 1204 | * | ||
| 1205 | * @return array The array with the global data | ||
| 1206 | */ | ||
| 1207 | public function getGlobalData() | ||
| 1279 | } | ||
| 1280 | 
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.