Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
Complex classes like AbstractSubject 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 AbstractSubject, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 52 | abstract class AbstractSubject implements SubjectInterface, FilesystemSubjectInterface, DateConverterSubjectInterface |
||
| 53 | { |
||
| 54 | |||
| 55 | /** |
||
| 56 | * The trait that provides basic filesystem handling functionality. |
||
| 57 | * |
||
| 58 | * @var \TechDivision\Import\Subjects\FilesystemTrait |
||
| 59 | */ |
||
| 60 | use FilesystemTrait; |
||
| 61 | |||
| 62 | /** |
||
| 63 | * The trait that provides basic filesystem handling functionality. |
||
| 64 | * |
||
| 65 | * @var \TechDivision\Import\SystemLoggerTrait |
||
| 66 | */ |
||
| 67 | use SystemLoggerTrait; |
||
| 68 | |||
| 69 | /** |
||
| 70 | * The trait that provides date converting functionality. |
||
| 71 | * |
||
| 72 | * @var \TechDivision\Import\DateConverterTrait |
||
| 73 | */ |
||
| 74 | use DateConverterTrait; |
||
| 75 | |||
| 76 | /** |
||
| 77 | * The trait that provides header handling functionality. |
||
| 78 | * |
||
| 79 | * @var \TechDivision\Import\HeaderTrait |
||
| 80 | */ |
||
| 81 | use HeaderTrait; |
||
| 82 | |||
| 83 | /** |
||
| 84 | * The trait that provides row handling functionality. |
||
| 85 | * |
||
| 86 | * @var \TechDivision\Import\RowTrait |
||
| 87 | */ |
||
| 88 | use RowTrait; |
||
| 89 | |||
| 90 | /** |
||
| 91 | * The unique identifier for the actual invocation. |
||
| 92 | * |
||
| 93 | * @var string |
||
| 94 | */ |
||
| 95 | protected $uniqueId; |
||
| 96 | |||
| 97 | /** |
||
| 98 | * The name of the file to be imported. |
||
| 99 | * |
||
| 100 | * @var string |
||
| 101 | */ |
||
| 102 | protected $filename; |
||
| 103 | |||
| 104 | /** |
||
| 105 | * The actual line number. |
||
| 106 | * |
||
| 107 | * @var integer |
||
| 108 | */ |
||
| 109 | protected $lineNumber = 0; |
||
| 110 | |||
| 111 | /** |
||
| 112 | * The import adapter instance. |
||
| 113 | * |
||
| 114 | * @var \TechDivision\Import\Adapter\ImportAdapterInterface |
||
| 115 | */ |
||
| 116 | protected $importAdapter; |
||
| 117 | |||
| 118 | /** |
||
| 119 | * The subject configuration. |
||
| 120 | * |
||
| 121 | * @var \TechDivision\Import\Configuration\SubjectConfigurationInterface |
||
| 122 | */ |
||
| 123 | protected $configuration; |
||
| 124 | |||
| 125 | /** |
||
| 126 | * The plugin configuration. |
||
| 127 | * |
||
| 128 | * @var \TechDivision\Import\Configuration\PluginConfigurationInterface |
||
| 129 | */ |
||
| 130 | protected $pluginConfiguration; |
||
| 131 | |||
| 132 | /** |
||
| 133 | * The RegistryProcessor instance to handle running threads. |
||
| 134 | * |
||
| 135 | * @var \TechDivision\Import\Services\RegistryProcessorInterface |
||
| 136 | */ |
||
| 137 | protected $registryProcessor; |
||
| 138 | |||
| 139 | /** |
||
| 140 | * The actions unique serial. |
||
| 141 | * |
||
| 142 | * @var string |
||
| 143 | */ |
||
| 144 | protected $serial; |
||
| 145 | |||
| 146 | /** |
||
| 147 | * Array with the subject's observers. |
||
| 148 | * |
||
| 149 | * @var array |
||
| 150 | */ |
||
| 151 | protected $observers = array(); |
||
| 152 | |||
| 153 | /** |
||
| 154 | * Array with the subject's callbacks. |
||
| 155 | * |
||
| 156 | * @var array |
||
| 157 | */ |
||
| 158 | protected $callbacks = array(); |
||
| 159 | |||
| 160 | /** |
||
| 161 | * The subject's callback mappings. |
||
| 162 | * |
||
| 163 | * @var array |
||
| 164 | */ |
||
| 165 | protected $callbackMappings = array(); |
||
| 166 | |||
| 167 | /** |
||
| 168 | * The available root categories. |
||
| 169 | * |
||
| 170 | * @var array |
||
| 171 | */ |
||
| 172 | protected $rootCategories = array(); |
||
| 173 | |||
| 174 | /** |
||
| 175 | * The Magento configuration. |
||
| 176 | * |
||
| 177 | * @var array |
||
| 178 | */ |
||
| 179 | protected $coreConfigData = array(); |
||
| 180 | |||
| 181 | /** |
||
| 182 | * The available stores. |
||
| 183 | * |
||
| 184 | * @var array |
||
| 185 | */ |
||
| 186 | protected $stores = array(); |
||
| 187 | |||
| 188 | /** |
||
| 189 | * The available websites. |
||
| 190 | * |
||
| 191 | * @var array |
||
| 192 | */ |
||
| 193 | protected $storeWebsites = array(); |
||
| 194 | |||
| 195 | /** |
||
| 196 | * The default store. |
||
| 197 | * |
||
| 198 | * @var array |
||
| 199 | */ |
||
| 200 | protected $defaultStore; |
||
| 201 | |||
| 202 | /** |
||
| 203 | * The store view code the create the product/attributes for. |
||
| 204 | * |
||
| 205 | * @var string |
||
| 206 | */ |
||
| 207 | protected $storeViewCode; |
||
| 208 | |||
| 209 | /** |
||
| 210 | * The UID generator for the core config data. |
||
| 211 | * |
||
| 212 | * @var \TechDivision\Import\Utils\Generators\GeneratorInterface |
||
| 213 | */ |
||
| 214 | protected $coreConfigDataUidGenerator; |
||
| 215 | |||
| 216 | /** |
||
| 217 | * UNIX timestamp with the date the last row counter has been logged. |
||
| 218 | * |
||
| 219 | * @var integer |
||
| 220 | */ |
||
| 221 | protected $lastLog = 0; |
||
| 222 | |||
| 223 | /** |
||
| 224 | * The number of the last line that has been logged with the row counter |
||
| 225 | * @var integer |
||
| 226 | */ |
||
| 227 | protected $lastLineNumber = 0; |
||
| 228 | |||
| 229 | /** |
||
| 230 | * The event emitter instance. |
||
| 231 | * |
||
| 232 | * @var \League\Event\EmitterInterface |
||
| 233 | */ |
||
| 234 | protected $emitter; |
||
| 235 | |||
| 236 | /** |
||
| 237 | * The status of the file (0 = not processed, 1 = successfully processed, 2 = processed with failure) |
||
| 238 | * |
||
| 239 | * @var array |
||
| 240 | */ |
||
| 241 | protected $status = array(); |
||
| 242 | |||
| 243 | /** |
||
| 244 | * Mapping for the virtual entity type code to the real Magento 2 EAV entity type code. |
||
| 245 | * |
||
| 246 | * @var array |
||
| 247 | */ |
||
| 248 | protected $entityTypeCodeMappings = array( |
||
| 249 | EntityTypeCodes::EAV_ATTRIBUTE => EntityTypeCodes::CATALOG_PRODUCT, |
||
| 250 | EntityTypeCodes::EAV_ATTRIBUTE_SET => EntityTypeCodes::CATALOG_PRODUCT, |
||
| 251 | EntityTypeCodes::CATALOG_PRODUCT_PRICE => EntityTypeCodes::CATALOG_PRODUCT, |
||
| 252 | EntityTypeCodes::CATALOG_PRODUCT_INVENTORY => EntityTypeCodes::CATALOG_PRODUCT, |
||
| 253 | EntityTypeCodes::CATALOG_PRODUCT_INVENTORY_MSI => EntityTypeCodes::CATALOG_PRODUCT, |
||
| 254 | EntityTypeCodes::CATALOG_PRODUCT_TIER_PRICE => EntityTypeCodes::CATALOG_PRODUCT |
||
| 255 | ); |
||
| 256 | |||
| 257 | /** |
||
| 258 | * Initialize the subject instance. |
||
| 259 | * |
||
| 260 | * @param \TechDivision\Import\Services\RegistryProcessorInterface $registryProcessor The registry processor instance |
||
| 261 | * @param \TechDivision\Import\Utils\Generators\GeneratorInterface $coreConfigDataUidGenerator The UID generator for the core config data |
||
| 262 | * @param \Doctrine\Common\Collections\Collection $systemLoggers The array with the system loggers instances |
||
| 263 | * @param \League\Event\EmitterInterface $emitter The event emitter instance |
||
| 264 | */ |
||
| 265 | 82 | public function __construct( |
|
| 276 | |||
| 277 | /** |
||
| 278 | * Return's the event emitter instance. |
||
| 279 | * |
||
| 280 | * @return \League\Event\EmitterInterface The event emitter instance |
||
| 281 | */ |
||
| 282 | public function getEmitter() |
||
| 286 | |||
| 287 | /** |
||
| 288 | * Set's the name of the file to import |
||
| 289 | * |
||
| 290 | * @param string $filename The filename |
||
| 291 | * |
||
| 292 | * @return void |
||
| 293 | */ |
||
| 294 | public function setFilename($filename) |
||
| 298 | |||
| 299 | /** |
||
| 300 | * Return's the name of the file to import. |
||
| 301 | * |
||
| 302 | * @return string The filename |
||
| 303 | */ |
||
| 304 | public function getFilename() |
||
| 308 | |||
| 309 | /** |
||
| 310 | * Set's the actual line number. |
||
| 311 | * |
||
| 312 | * @param integer $lineNumber The line number |
||
| 313 | * |
||
| 314 | * @return void |
||
| 315 | */ |
||
| 316 | public function setLineNumber($lineNumber) |
||
| 320 | |||
| 321 | /** |
||
| 322 | * Return's the actual line number. |
||
| 323 | * |
||
| 324 | * @return integer The line number |
||
| 325 | */ |
||
| 326 | public function getLineNumber() |
||
| 330 | |||
| 331 | /** |
||
| 332 | * Return's the default callback mappings. |
||
| 333 | * |
||
| 334 | * @return array The default callback mappings |
||
| 335 | */ |
||
| 336 | public function getDefaultCallbackMappings() |
||
| 340 | |||
| 341 | /** |
||
| 342 | * Load the default header mappings from the configuration. |
||
| 343 | * |
||
| 344 | * @return array |
||
| 345 | */ |
||
| 346 | 82 | public function getDefaultHeaderMappings() |
|
| 366 | |||
| 367 | /** |
||
| 368 | * Tries to format the passed value to a valid date with format 'Y-m-d H:i:s'. |
||
| 369 | * If the passed value is NOT a valid date, NULL will be returned. |
||
| 370 | * |
||
| 371 | * @param string $value The value to format |
||
| 372 | * |
||
| 373 | * @return string|null The formatted date or NULL if the date is not valid |
||
| 374 | */ |
||
| 375 | public function formatDate($value) |
||
| 379 | |||
| 380 | /** |
||
| 381 | * Extracts the elements of the passed value by exploding them |
||
| 382 | * with the also passed delimiter. |
||
| 383 | * |
||
| 384 | * @param string $value The value to extract |
||
| 385 | * @param string|null $delimiter The delimiter used to extrace the elements |
||
| 386 | * |
||
| 387 | * @return array The exploded values |
||
| 388 | */ |
||
| 389 | public function explode($value, $delimiter = null) |
||
| 393 | |||
| 394 | /** |
||
| 395 | * Queries whether or not debug mode is enabled or not, default is TRUE. |
||
| 396 | * |
||
| 397 | * @return boolean TRUE if debug mode is enabled, else FALSE |
||
| 398 | */ |
||
| 399 | public function isDebugMode() |
||
| 403 | |||
| 404 | /** |
||
| 405 | * Return's the subject's execution context configuration. |
||
| 406 | * |
||
| 407 | * @return \TechDivision\Import\ExecutionContextInterface The execution context configuration to use |
||
| 408 | */ |
||
| 409 | 5 | public function getExecutionContext() |
|
| 413 | |||
| 414 | /** |
||
| 415 | * Set's the subject configuration. |
||
| 416 | * |
||
| 417 | * @param \TechDivision\Import\Configuration\SubjectConfigurationInterface $configuration The subject configuration |
||
| 418 | * |
||
| 419 | * @return void |
||
| 420 | */ |
||
| 421 | 82 | public function setConfiguration(SubjectConfigurationInterface $configuration) |
|
| 425 | |||
| 426 | /** |
||
| 427 | * Return's the subject configuration. |
||
| 428 | * |
||
| 429 | * @return \TechDivision\Import\Configuration\SubjectConfigurationInterface The subject configuration |
||
| 430 | */ |
||
| 431 | 39 | public function getConfiguration() |
|
| 435 | |||
| 436 | /** |
||
| 437 | * Set's the import adapter instance. |
||
| 438 | * |
||
| 439 | * @param \TechDivision\Import\Adapter\ImportAdapterInterface $importAdapter The import adapter instance |
||
| 440 | * |
||
| 441 | * @return void |
||
| 442 | */ |
||
| 443 | public function setImportAdapter(ImportAdapterInterface $importAdapter) |
||
| 447 | |||
| 448 | /** |
||
| 449 | * Return's the import adapter instance. |
||
| 450 | * |
||
| 451 | * @return \TechDivision\Import\Adapter\ImportAdapterInterface The import adapter instance |
||
| 452 | */ |
||
| 453 | public function getImportAdapter() |
||
| 457 | |||
| 458 | /** |
||
| 459 | * Return's the RegistryProcessor instance to handle the running threads. |
||
| 460 | * |
||
| 461 | * @return \TechDivision\Import\Services\RegistryProcessorInterface The registry processor instance |
||
| 462 | */ |
||
| 463 | 82 | public function getRegistryProcessor() |
|
| 467 | |||
| 468 | /** |
||
| 469 | * Set's the unique serial for this import process. |
||
| 470 | * |
||
| 471 | * @param string $serial The unique serial |
||
| 472 | * |
||
| 473 | * @return void |
||
| 474 | */ |
||
| 475 | public function setSerial($serial) |
||
| 479 | |||
| 480 | /** |
||
| 481 | * Return's the unique serial for this import process. |
||
| 482 | * |
||
| 483 | * @return string The unique serial |
||
| 484 | */ |
||
| 485 | public function getSerial() |
||
| 489 | |||
| 490 | /** |
||
| 491 | * Merge's the passed status into the actual one. |
||
| 492 | * |
||
| 493 | * @param array $status The status to MergeBuilder |
||
| 494 | * |
||
| 495 | * @return void |
||
| 496 | */ |
||
| 497 | public function mergeStatus(array $status) |
||
| 501 | |||
| 502 | /** |
||
| 503 | * Retur's the actual status. |
||
| 504 | * |
||
| 505 | * @return array The actual status |
||
| 506 | */ |
||
| 507 | public function getStatus() |
||
| 511 | |||
| 512 | /** |
||
| 513 | * Return's the unique identifier for the actual invocation. |
||
| 514 | * |
||
| 515 | * @return string The unique identifier |
||
| 516 | */ |
||
| 517 | public function getUniqueId() |
||
| 521 | |||
| 522 | /** |
||
| 523 | * Return's the source date format to use. |
||
| 524 | * |
||
| 525 | * @return string The source date format |
||
| 526 | */ |
||
| 527 | public function getSourceDateFormat() |
||
| 531 | |||
| 532 | /** |
||
| 533 | * Return's the multiple field delimiter character to use, default value is comma (,). |
||
| 534 | * |
||
| 535 | * @return string The multiple field delimiter character |
||
| 536 | */ |
||
| 537 | public function getMultipleFieldDelimiter() |
||
| 541 | |||
| 542 | /** |
||
| 543 | * Return's the multiple value delimiter character to use, default value is comma (|). |
||
| 544 | * |
||
| 545 | * @return string The multiple value delimiter character |
||
| 546 | */ |
||
| 547 | public function getMultipleValueDelimiter() |
||
| 551 | |||
| 552 | /** |
||
| 553 | * Intializes the previously loaded global data for exactly one bunch. |
||
| 554 | * |
||
| 555 | * @param string $serial The serial of the actual import |
||
| 556 | * |
||
| 557 | * @return void |
||
| 558 | */ |
||
| 559 | 82 | public function setUp($serial) |
|
| 602 | |||
| 603 | /** |
||
| 604 | * Clean up the global data after importing the variants. |
||
| 605 | * |
||
| 606 | * @param string $serial The serial of the actual import |
||
| 607 | * |
||
| 608 | * @return void |
||
| 609 | */ |
||
| 610 | public function tearDown($serial) |
||
| 626 | |||
| 627 | /** |
||
| 628 | * Return's the target directory for the artefact export. |
||
| 629 | * |
||
| 630 | * @return string The target directory for the artefact export |
||
| 631 | */ |
||
| 632 | View Code Duplication | public function getTargetDir() |
|
| 646 | |||
| 647 | /** |
||
| 648 | * Register the passed observer with the specific type. |
||
| 649 | * |
||
| 650 | * @param \TechDivision\Import\Observers\ObserverInterface $observer The observer to register |
||
| 651 | * @param string $type The type to register the observer with |
||
| 652 | * |
||
| 653 | * @return void |
||
| 654 | */ |
||
| 655 | public function registerObserver(ObserverInterface $observer, $type) |
||
| 667 | |||
| 668 | /** |
||
| 669 | * Register the passed callback with the specific type. |
||
| 670 | * |
||
| 671 | * @param \TechDivision\Import\Callbacks\CallbackInterface $callback The subject to register the callbacks for |
||
| 672 | * @param string $type The type to register the callback with |
||
| 673 | * |
||
| 674 | * @return void |
||
| 675 | */ |
||
| 676 | public function registerCallback(CallbackInterface $callback, $type) |
||
| 688 | |||
| 689 | /** |
||
| 690 | * Return's the array with callbacks for the passed type. |
||
| 691 | * |
||
| 692 | * @param string $type The type of the callbacks to return |
||
| 693 | * |
||
| 694 | * @return array The callbacks |
||
| 695 | */ |
||
| 696 | public function getCallbacksByType($type) |
||
| 710 | |||
| 711 | /** |
||
| 712 | * Return's the array with the available observers. |
||
| 713 | * |
||
| 714 | * @return array The observers |
||
| 715 | */ |
||
| 716 | public function getObservers() |
||
| 720 | |||
| 721 | /** |
||
| 722 | * Return's the array with the available callbacks. |
||
| 723 | * |
||
| 724 | * @return array The callbacks |
||
| 725 | */ |
||
| 726 | public function getCallbacks() |
||
| 730 | |||
| 731 | /** |
||
| 732 | * Return's the callback mappings for this subject. |
||
| 733 | * |
||
| 734 | * @return array The array with the subject's callback mappings |
||
| 735 | */ |
||
| 736 | public function getCallbackMappings() |
||
| 740 | |||
| 741 | /** |
||
| 742 | * Imports the content of the file with the passed filename. |
||
| 743 | * |
||
| 744 | * |
||
| 745 | * @param string $serial The serial of the actual import |
||
| 746 | * @param string $filename The filename to process |
||
| 747 | * |
||
| 748 | * @return void |
||
| 749 | * @throws \Exception Is thrown, if the import can't be processed |
||
| 750 | */ |
||
| 751 | public function import($serial, $filename) |
||
| 863 | |||
| 864 | /** |
||
| 865 | * Imports the passed row into the database. If the import failed, the exception |
||
| 866 | * will be catched and logged, but the import process will be continued. |
||
| 867 | * |
||
| 868 | * @param array $row The row with the data to be imported |
||
| 869 | * |
||
| 870 | * @return void |
||
| 871 | */ |
||
| 872 | public function importRow(array $row) |
||
| 963 | |||
| 964 | /** |
||
| 965 | * Queries whether or not that the subject needs an OK file to be processed. |
||
| 966 | * |
||
| 967 | * @return boolean TRUE if the subject needs an OK file, else FALSE |
||
| 968 | */ |
||
| 969 | public function isOkFileNeeded() |
||
| 973 | |||
| 974 | /** |
||
| 975 | * Return's the default store. |
||
| 976 | * |
||
| 977 | * @return array The default store |
||
| 978 | */ |
||
| 979 | public function getDefaultStore() |
||
| 983 | |||
| 984 | /** |
||
| 985 | * Return's the default store view code. |
||
| 986 | * |
||
| 987 | * @return array The default store view code |
||
| 988 | */ |
||
| 989 | public function getDefaultStoreViewCode() |
||
| 993 | |||
| 994 | /** |
||
| 995 | * Set's the store view code the create the product/attributes for. |
||
| 996 | * |
||
| 997 | * @param string $storeViewCode The store view code |
||
| 998 | * |
||
| 999 | * @return void |
||
| 1000 | */ |
||
| 1001 | public function setStoreViewCode($storeViewCode) |
||
| 1005 | |||
| 1006 | /** |
||
| 1007 | * Return's the store view code the create the product/attributes for. |
||
| 1008 | * |
||
| 1009 | * @param string|null $default The default value to return, if the store view code has not been set |
||
| 1010 | * |
||
| 1011 | * @return string The store view code |
||
| 1012 | */ |
||
| 1013 | public function getStoreViewCode($default = null) |
||
| 1030 | |||
| 1031 | /** |
||
| 1032 | * Prepare's the store view code in the subject. If the store_view_code row doesn't contain |
||
| 1033 | * any value, the default code of the default store view will be set. |
||
| 1034 | * |
||
| 1035 | * @return void |
||
| 1036 | */ |
||
| 1037 | public function prepareStoreViewCode() |
||
| 1048 | |||
| 1049 | /** |
||
| 1050 | * Return's the store ID of the store with the passed store view code |
||
| 1051 | * |
||
| 1052 | * @param string $storeViewCode The store view code to return the store ID for |
||
| 1053 | * |
||
| 1054 | * @return integer The ID of the store with the passed ID |
||
| 1055 | * @throws \Exception Is thrown, if the store with the actual code is not available |
||
| 1056 | */ |
||
| 1057 | public function getStoreId($storeViewCode) |
||
| 1075 | |||
| 1076 | /** |
||
| 1077 | * Return's the store ID of the actual row, or of the default store |
||
| 1078 | * if no store view code is set in the CSV file. |
||
| 1079 | * |
||
| 1080 | * @param string|null $default The default store view code to use, if no store view code is set in the CSV file |
||
| 1081 | * |
||
| 1082 | * @return integer The ID of the actual store |
||
| 1083 | * @throws \Exception Is thrown, if the store with the actual code is not available |
||
| 1084 | */ |
||
| 1085 | public function getRowStoreId($default = null) |
||
| 1096 | |||
| 1097 | /** |
||
| 1098 | * Return's the root category for the actual view store. |
||
| 1099 | * |
||
| 1100 | * @return array The store's root category |
||
| 1101 | * @throws \Exception Is thrown if the root category for the passed store code is NOT available |
||
| 1102 | */ |
||
| 1103 | public function getRootCategory() |
||
| 1117 | |||
| 1118 | /** |
||
| 1119 | * Return's the Magento configuration value. |
||
| 1120 | * |
||
| 1121 | * @param string $path The Magento path of the requested configuration value |
||
| 1122 | * @param mixed $default The default value that has to be returned, if the requested configuration value is not set |
||
| 1123 | * @param string $scope The scope the configuration value has been set |
||
| 1124 | * @param integer $scopeId The scope ID the configuration value has been set |
||
| 1125 | * |
||
| 1126 | * @return mixed The configuration value |
||
| 1127 | * @throws \Exception Is thrown, if nor a value can be found or a default value has been passed |
||
| 1128 | */ |
||
| 1129 | public function getCoreConfigData($path, $default = null, $scope = ScopeKeys::SCOPE_DEFAULT, $scopeId = 0) |
||
| 1205 | |||
| 1206 | /** |
||
| 1207 | * Resolve the original column name for the passed one. |
||
| 1208 | * |
||
| 1209 | * @param string $columnName The column name that has to be resolved |
||
| 1210 | * |
||
| 1211 | * @return string|null The original column name |
||
| 1212 | */ |
||
| 1213 | public function resolveOriginalColumnName($columnName) |
||
| 1235 | |||
| 1236 | /** |
||
| 1237 | * Return's the original data if available, or an empty array. |
||
| 1238 | * |
||
| 1239 | * @return array The original data |
||
| 1240 | */ |
||
| 1241 | public function getOriginalData() |
||
| 1256 | |||
| 1257 | /** |
||
| 1258 | * Query's whether or not the actual column contains original data like |
||
| 1259 | * filename, line number and column names. |
||
| 1260 | * |
||
| 1261 | * @return boolean TRUE if the actual column contains origin data, else FALSE |
||
| 1262 | */ |
||
| 1263 | public function hasOriginalData() |
||
| 1267 | |||
| 1268 | /** |
||
| 1269 | * Wraps the passed exeception into a new one by trying to resolve the original filname, |
||
| 1270 | * line number and column names and use it for a detailed exception message. |
||
| 1271 | * |
||
| 1272 | * @param array $columnNames The column names that should be resolved and wrapped |
||
| 1273 | * @param \Exception $parent The exception we want to wrap |
||
| 1274 | * @param string $className The class name of the exception type we want to wrap the parent one |
||
| 1275 | * |
||
| 1276 | * @return \Exception the wrapped exception |
||
| 1277 | */ |
||
| 1278 | public function wrapException( |
||
| 1322 | |||
| 1323 | /** |
||
| 1324 | * Strip's the exception suffix containing filename and line number from the |
||
| 1325 | * passed message. |
||
| 1326 | * |
||
| 1327 | * @param string $message The message to strip the exception suffix from |
||
| 1328 | * |
||
| 1329 | * @return mixed The message without the exception suffix |
||
| 1330 | */ |
||
| 1331 | public function stripExceptionSuffix($message) |
||
| 1335 | |||
| 1336 | /** |
||
| 1337 | * Append's the exception suffix containing filename and line number to the |
||
| 1338 | * passed message. If no message has been passed, only the suffix will be |
||
| 1339 | * returned |
||
| 1340 | * |
||
| 1341 | * @param string|null $message The message to append the exception suffix to |
||
| 1342 | * @param string|null $filename The filename used to create the suffix |
||
| 1343 | * @param string|null $lineNumber The line number used to create the suffx |
||
| 1344 | * |
||
| 1345 | * @return string The message with the appended exception suffix |
||
| 1346 | */ |
||
| 1347 | public function appendExceptionSuffix($message = null, $filename = null, $lineNumber = null) |
||
| 1368 | |||
| 1369 | /** |
||
| 1370 | * Raises the value for the counter with the passed key by one. |
||
| 1371 | * |
||
| 1372 | * @param mixed $counterName The name of the counter to raise |
||
| 1373 | * |
||
| 1374 | * @return integer The counter's new value |
||
| 1375 | */ |
||
| 1376 | public function raiseCounter($counterName) |
||
| 1385 | |||
| 1386 | /** |
||
| 1387 | * Merge the passed array into the status of the actual import. |
||
| 1388 | * |
||
| 1389 | * @param array $status The status information to be merged |
||
| 1390 | * |
||
| 1391 | * @return void |
||
| 1392 | */ |
||
| 1393 | public function mergeAttributesRecursive(array $status) |
||
| 1402 | |||
| 1403 | /** |
||
| 1404 | * Return's the entity type code to be used. |
||
| 1405 | * |
||
| 1406 | * @return string The entity type code to be used |
||
| 1407 | */ |
||
| 1408 | public function getEntityTypeCode() |
||
| 1422 | |||
| 1423 | /** |
||
| 1424 | * Concatenates and returns the event name for the actual plugin and subject context. |
||
| 1425 | * |
||
| 1426 | * @param string $eventName The event name to concatenate |
||
| 1427 | * |
||
| 1428 | * @return string The concatenated event name |
||
| 1429 | */ |
||
| 1430 | protected function getEventName($eventName) |
||
| 1439 | } |
||
| 1440 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..