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 |
||
| 51 | abstract class AbstractSubject implements SubjectInterface, FilesystemSubjectInterface, DateConverterSubjectInterface |
||
| 52 | { |
||
| 53 | |||
| 54 | /** |
||
| 55 | * The trait that provides basic filesystem handling functionality. |
||
| 56 | * |
||
| 57 | * @var \TechDivision\Import\Subjects\FilesystemTrait |
||
| 58 | */ |
||
| 59 | use FilesystemTrait; |
||
| 60 | |||
| 61 | /** |
||
| 62 | * The trait that provides basic filesystem handling functionality. |
||
| 63 | * |
||
| 64 | * @var \TechDivision\Import\SystemLoggerTrait |
||
| 65 | */ |
||
| 66 | use SystemLoggerTrait; |
||
| 67 | |||
| 68 | /** |
||
| 69 | * The trait that provides date converting functionality. |
||
| 70 | * |
||
| 71 | * @var \TechDivision\Import\DateConverterTrait |
||
| 72 | */ |
||
| 73 | use DateConverterTrait; |
||
| 74 | |||
| 75 | /** |
||
| 76 | * The trait that provides header handling functionality. |
||
| 77 | * |
||
| 78 | * @var \TechDivision\Import\HeaderTrait |
||
| 79 | */ |
||
| 80 | use HeaderTrait; |
||
| 81 | |||
| 82 | /** |
||
| 83 | * The trait that provides row handling functionality. |
||
| 84 | * |
||
| 85 | * @var \TechDivision\Import\RowTrait |
||
| 86 | */ |
||
| 87 | use RowTrait; |
||
| 88 | |||
| 89 | /** |
||
| 90 | * The name of the file to be imported. |
||
| 91 | * |
||
| 92 | * @var string |
||
| 93 | */ |
||
| 94 | protected $filename; |
||
| 95 | |||
| 96 | /** |
||
| 97 | * The actual line number. |
||
| 98 | * |
||
| 99 | * @var integer |
||
| 100 | */ |
||
| 101 | protected $lineNumber = 0; |
||
| 102 | |||
| 103 | /** |
||
| 104 | * The import adapter instance. |
||
| 105 | * |
||
| 106 | * @var \TechDivision\Import\Adapter\ImportAdapterInterface |
||
| 107 | */ |
||
| 108 | protected $importAdapter; |
||
| 109 | |||
| 110 | /** |
||
| 111 | * The subject configuration. |
||
| 112 | * |
||
| 113 | * @var \TechDivision\Import\Configuration\SubjectConfigurationInterface |
||
| 114 | */ |
||
| 115 | protected $configuration; |
||
| 116 | |||
| 117 | /** |
||
| 118 | * The plugin configuration. |
||
| 119 | * |
||
| 120 | * @var \TechDivision\Import\Configuration\PluginConfigurationInterface |
||
| 121 | */ |
||
| 122 | protected $pluginConfiguration; |
||
| 123 | |||
| 124 | /** |
||
| 125 | * The RegistryProcessor instance to handle running threads. |
||
| 126 | * |
||
| 127 | * @var \TechDivision\Import\Services\RegistryProcessorInterface |
||
| 128 | */ |
||
| 129 | protected $registryProcessor; |
||
| 130 | |||
| 131 | /** |
||
| 132 | * The actions unique serial. |
||
| 133 | * |
||
| 134 | * @var string |
||
| 135 | */ |
||
| 136 | protected $serial; |
||
| 137 | |||
| 138 | /** |
||
| 139 | * Array with the subject's observers. |
||
| 140 | * |
||
| 141 | * @var array |
||
| 142 | */ |
||
| 143 | protected $observers = array(); |
||
| 144 | |||
| 145 | /** |
||
| 146 | * Array with the subject's callbacks. |
||
| 147 | * |
||
| 148 | * @var array |
||
| 149 | */ |
||
| 150 | protected $callbacks = array(); |
||
| 151 | |||
| 152 | /** |
||
| 153 | * The subject's callback mappings. |
||
| 154 | * |
||
| 155 | * @var array |
||
| 156 | */ |
||
| 157 | protected $callbackMappings = array(); |
||
| 158 | |||
| 159 | /** |
||
| 160 | * The available root categories. |
||
| 161 | * |
||
| 162 | * @var array |
||
| 163 | */ |
||
| 164 | protected $rootCategories = array(); |
||
| 165 | |||
| 166 | /** |
||
| 167 | * The Magento configuration. |
||
| 168 | * |
||
| 169 | * @var array |
||
| 170 | */ |
||
| 171 | protected $coreConfigData = array(); |
||
| 172 | |||
| 173 | /** |
||
| 174 | * The available stores. |
||
| 175 | * |
||
| 176 | * @var array |
||
| 177 | */ |
||
| 178 | protected $stores = array(); |
||
| 179 | |||
| 180 | /** |
||
| 181 | * The available websites. |
||
| 182 | * |
||
| 183 | * @var array |
||
| 184 | */ |
||
| 185 | protected $storeWebsites = array(); |
||
| 186 | |||
| 187 | /** |
||
| 188 | * The default store. |
||
| 189 | * |
||
| 190 | * @var array |
||
| 191 | */ |
||
| 192 | protected $defaultStore; |
||
| 193 | |||
| 194 | /** |
||
| 195 | * The store view code the create the product/attributes for. |
||
| 196 | * |
||
| 197 | * @var string |
||
| 198 | */ |
||
| 199 | protected $storeViewCode; |
||
| 200 | |||
| 201 | /** |
||
| 202 | * The UID generator for the core config data. |
||
| 203 | * |
||
| 204 | * @var \TechDivision\Import\Utils\Generators\GeneratorInterface |
||
| 205 | */ |
||
| 206 | protected $coreConfigDataUidGenerator; |
||
| 207 | |||
| 208 | /** |
||
| 209 | * UNIX timestamp with the date the last row counter has been logged. |
||
| 210 | * |
||
| 211 | * @var integer |
||
| 212 | */ |
||
| 213 | protected $lastLog = 0; |
||
| 214 | |||
| 215 | /** |
||
| 216 | * The number of the last line that has been logged with the row counter |
||
| 217 | * @var integer |
||
| 218 | */ |
||
| 219 | protected $lastLineNumber = 0; |
||
| 220 | |||
| 221 | /** |
||
| 222 | * The event emitter instance. |
||
| 223 | * |
||
| 224 | * @var \League\Event\EmitterInterface |
||
| 225 | */ |
||
| 226 | protected $emitter; |
||
| 227 | |||
| 228 | /** |
||
| 229 | * Mapping for the virtual entity type code to the real Magento 2 EAV entity type code. |
||
| 230 | * |
||
| 231 | * @var array |
||
| 232 | */ |
||
| 233 | protected $entityTypeCodeMappings = array( |
||
| 234 | EntityTypeCodes::EAV_ATTRIBUTE => EntityTypeCodes::CATALOG_PRODUCT, |
||
| 235 | EntityTypeCodes::EAV_ATTRIBUTE_SET => EntityTypeCodes::CATALOG_PRODUCT, |
||
| 236 | EntityTypeCodes::CATALOG_PRODUCT_PRICE => EntityTypeCodes::CATALOG_PRODUCT, |
||
| 237 | EntityTypeCodes::CATALOG_PRODUCT_INVENTORY => EntityTypeCodes::CATALOG_PRODUCT, |
||
| 238 | EntityTypeCodes::CATALOG_PRODUCT_INVENTORY_MSI => EntityTypeCodes::CATALOG_PRODUCT, |
||
| 239 | EntityTypeCodes::CATALOG_PRODUCT_TIER_PRICE => EntityTypeCodes::CATALOG_PRODUCT |
||
| 240 | ); |
||
| 241 | |||
| 242 | /** |
||
| 243 | * Initialize the subject instance. |
||
| 244 | * |
||
| 245 | * @param \TechDivision\Import\Services\RegistryProcessorInterface $registryProcessor The registry processor instance |
||
| 246 | * @param \TechDivision\Import\Utils\Generators\GeneratorInterface $coreConfigDataUidGenerator The UID generator for the core config data |
||
| 247 | * @param \Doctrine\Common\Collections\Collection $systemLoggers The array with the system loggers instances |
||
| 248 | * @param \League\Event\EmitterInterface $emitter The event emitter instance |
||
| 249 | */ |
||
| 250 | public function __construct( |
||
| 261 | |||
| 262 | /** |
||
| 263 | * Return's the event emitter instance. |
||
| 264 | * |
||
| 265 | * @return \League\Event\EmitterInterface The event emitter instance |
||
| 266 | */ |
||
| 267 | public function getEmitter() |
||
| 271 | |||
| 272 | /** |
||
| 273 | * Set's the name of the file to import |
||
| 274 | * |
||
| 275 | * @param string $filename The filename |
||
| 276 | * |
||
| 277 | * @return void |
||
| 278 | */ |
||
| 279 | public function setFilename($filename) |
||
| 283 | |||
| 284 | /** |
||
| 285 | * Return's the name of the file to import. |
||
| 286 | * |
||
| 287 | * @return string The filename |
||
| 288 | */ |
||
| 289 | public function getFilename() |
||
| 293 | |||
| 294 | /** |
||
| 295 | * Set's the actual line number. |
||
| 296 | * |
||
| 297 | * @param integer $lineNumber The line number |
||
| 298 | * |
||
| 299 | * @return void |
||
| 300 | */ |
||
| 301 | public function setLineNumber($lineNumber) |
||
| 305 | |||
| 306 | /** |
||
| 307 | * Return's the actual line number. |
||
| 308 | * |
||
| 309 | * @return integer The line number |
||
| 310 | */ |
||
| 311 | public function getLineNumber() |
||
| 315 | |||
| 316 | /** |
||
| 317 | * Return's the default callback mappings. |
||
| 318 | * |
||
| 319 | * @return array The default callback mappings |
||
| 320 | */ |
||
| 321 | public function getDefaultCallbackMappings() |
||
| 325 | |||
| 326 | /** |
||
| 327 | * Tries to format the passed value to a valid date with format 'Y-m-d H:i:s'. |
||
| 328 | * If the passed value is NOT a valid date, NULL will be returned. |
||
| 329 | * |
||
| 330 | * @param string $value The value to format |
||
| 331 | * |
||
| 332 | * @return string|null The formatted date or NULL if the date is not valid |
||
| 333 | */ |
||
| 334 | public function formatDate($value) |
||
| 338 | |||
| 339 | /** |
||
| 340 | * Extracts the elements of the passed value by exploding them |
||
| 341 | * with the also passed delimiter. |
||
| 342 | * |
||
| 343 | * @param string $value The value to extract |
||
| 344 | * @param string|null $delimiter The delimiter used to extrace the elements |
||
| 345 | * |
||
| 346 | * @return array The exploded values |
||
| 347 | */ |
||
| 348 | public function explode($value, $delimiter = null) |
||
| 352 | |||
| 353 | /** |
||
| 354 | * Queries whether or not debug mode is enabled or not, default is TRUE. |
||
| 355 | * |
||
| 356 | * @return boolean TRUE if debug mode is enabled, else FALSE |
||
| 357 | */ |
||
| 358 | public function isDebugMode() |
||
| 362 | |||
| 363 | /** |
||
| 364 | * Return's the subject's execution context configuration. |
||
| 365 | * |
||
| 366 | * @return \TechDivision\Import\Configuration\ExecutionContextConfigurationInterface The execution context configuration to use |
||
| 367 | */ |
||
| 368 | public function getExecutionContext() |
||
| 372 | |||
| 373 | /** |
||
| 374 | * Set's the subject configuration. |
||
| 375 | * |
||
| 376 | * @param \TechDivision\Import\Configuration\SubjectConfigurationInterface $configuration The subject configuration |
||
| 377 | * |
||
| 378 | * @return void |
||
| 379 | */ |
||
| 380 | public function setConfiguration(SubjectConfigurationInterface $configuration) |
||
| 384 | |||
| 385 | /** |
||
| 386 | * Return's the subject configuration. |
||
| 387 | * |
||
| 388 | * @return \TechDivision\Import\Configuration\SubjectConfigurationInterface The subject configuration |
||
| 389 | */ |
||
| 390 | public function getConfiguration() |
||
| 394 | |||
| 395 | /** |
||
| 396 | * Set's the import adapter instance. |
||
| 397 | * |
||
| 398 | * @param \TechDivision\Import\Adapter\ImportAdapterInterface $importAdapter The import adapter instance |
||
| 399 | * |
||
| 400 | * @return void |
||
| 401 | */ |
||
| 402 | public function setImportAdapter(ImportAdapterInterface $importAdapter) |
||
| 406 | |||
| 407 | /** |
||
| 408 | * Return's the import adapter instance. |
||
| 409 | * |
||
| 410 | * @return \TechDivision\Import\Adapter\ImportAdapterInterface The import adapter instance |
||
| 411 | */ |
||
| 412 | public function getImportAdapter() |
||
| 416 | |||
| 417 | /** |
||
| 418 | * Return's the RegistryProcessor instance to handle the running threads. |
||
| 419 | * |
||
| 420 | * @return \TechDivision\Import\Services\RegistryProcessorInterface The registry processor instance |
||
| 421 | */ |
||
| 422 | public function getRegistryProcessor() |
||
| 426 | |||
| 427 | /** |
||
| 428 | * Set's the unique serial for this import process. |
||
| 429 | * |
||
| 430 | * @param string $serial The unique serial |
||
| 431 | * |
||
| 432 | * @return void |
||
| 433 | */ |
||
| 434 | public function setSerial($serial) |
||
| 438 | |||
| 439 | /** |
||
| 440 | * Return's the unique serial for this import process. |
||
| 441 | * |
||
| 442 | * @return string The unique serial |
||
| 443 | */ |
||
| 444 | public function getSerial() |
||
| 448 | |||
| 449 | /** |
||
| 450 | * Return's the source date format to use. |
||
| 451 | * |
||
| 452 | * @return string The source date format |
||
| 453 | */ |
||
| 454 | public function getSourceDateFormat() |
||
| 458 | |||
| 459 | /** |
||
| 460 | * Return's the multiple field delimiter character to use, default value is comma (,). |
||
| 461 | * |
||
| 462 | * @return string The multiple field delimiter character |
||
| 463 | */ |
||
| 464 | public function getMultipleFieldDelimiter() |
||
| 468 | |||
| 469 | /** |
||
| 470 | * Return's the multiple value delimiter character to use, default value is comma (|). |
||
| 471 | * |
||
| 472 | * @return string The multiple value delimiter character |
||
| 473 | */ |
||
| 474 | public function getMultipleValueDelimiter() |
||
| 478 | |||
| 479 | /** |
||
| 480 | * Intializes the previously loaded global data for exactly one bunch. |
||
| 481 | * |
||
| 482 | * @param string $serial The serial of the actual import |
||
| 483 | * |
||
| 484 | * @return void |
||
| 485 | */ |
||
| 486 | public function setUp($serial) |
||
| 526 | |||
| 527 | /** |
||
| 528 | * Clean up the global data after importing the variants. |
||
| 529 | * |
||
| 530 | * @param string $serial The serial of the actual import |
||
| 531 | * |
||
| 532 | * @return void |
||
| 533 | */ |
||
| 534 | public function tearDown($serial) |
||
| 554 | |||
| 555 | /** |
||
| 556 | * Return's the target directory for the artefact export. |
||
| 557 | * |
||
| 558 | * @return string The target directory for the artefact export |
||
| 559 | */ |
||
| 560 | public function getTargetDir() |
||
| 564 | |||
| 565 | /** |
||
| 566 | * Return's the next source directory, which will be the target directory |
||
| 567 | * of this subject, in most cases. |
||
| 568 | * |
||
| 569 | * @param string $serial The serial of the actual import |
||
| 570 | * |
||
| 571 | * @return string The new source directory |
||
| 572 | */ |
||
| 573 | public function getNewSourceDir($serial) |
||
| 577 | |||
| 578 | /** |
||
| 579 | * Register the passed observer with the specific type. |
||
| 580 | * |
||
| 581 | * @param \TechDivision\Import\Observers\ObserverInterface $observer The observer to register |
||
| 582 | * @param string $type The type to register the observer with |
||
| 583 | * |
||
| 584 | * @return void |
||
| 585 | */ |
||
| 586 | public function registerObserver(ObserverInterface $observer, $type) |
||
| 598 | |||
| 599 | /** |
||
| 600 | * Register the passed callback with the specific type. |
||
| 601 | * |
||
| 602 | * @param \TechDivision\Import\Callbacks\CallbackInterface $callback The subject to register the callbacks for |
||
| 603 | * @param string $type The type to register the callback with |
||
| 604 | * |
||
| 605 | * @return void |
||
| 606 | */ |
||
| 607 | public function registerCallback(CallbackInterface $callback, $type) |
||
| 619 | |||
| 620 | /** |
||
| 621 | * Return's the array with callbacks for the passed type. |
||
| 622 | * |
||
| 623 | * @param string $type The type of the callbacks to return |
||
| 624 | * |
||
| 625 | * @return array The callbacks |
||
| 626 | */ |
||
| 627 | public function getCallbacksByType($type) |
||
| 641 | |||
| 642 | /** |
||
| 643 | * Return's the array with the available observers. |
||
| 644 | * |
||
| 645 | * @return array The observers |
||
| 646 | */ |
||
| 647 | public function getObservers() |
||
| 651 | |||
| 652 | /** |
||
| 653 | * Return's the array with the available callbacks. |
||
| 654 | * |
||
| 655 | * @return array The callbacks |
||
| 656 | */ |
||
| 657 | public function getCallbacks() |
||
| 661 | |||
| 662 | /** |
||
| 663 | * Return's the callback mappings for this subject. |
||
| 664 | * |
||
| 665 | * @return array The array with the subject's callback mappings |
||
| 666 | */ |
||
| 667 | public function getCallbackMappings() |
||
| 671 | |||
| 672 | /** |
||
| 673 | * Imports the content of the file with the passed filename. |
||
| 674 | * |
||
| 675 | * |
||
| 676 | * @param string $serial The serial of the actual import |
||
| 677 | * @param string $filename The filename to process |
||
| 678 | * |
||
| 679 | * @return void |
||
| 680 | * @throws \Exception Is thrown, if the import can't be processed |
||
| 681 | */ |
||
| 682 | public function import($serial, $filename) |
||
| 758 | |||
| 759 | /** |
||
| 760 | * Imports the passed row into the database. If the import failed, the exception |
||
| 761 | * will be catched and logged, but the import process will be continued. |
||
| 762 | * |
||
| 763 | * @param array $row The row with the data to be imported |
||
| 764 | * |
||
| 765 | * @return void |
||
| 766 | */ |
||
| 767 | public function importRow(array $row) |
||
| 850 | |||
| 851 | /** |
||
| 852 | * Queries whether or not that the subject needs an OK file to be processed. |
||
| 853 | * |
||
| 854 | * @return boolean TRUE if the subject needs an OK file, else FALSE |
||
| 855 | */ |
||
| 856 | public function isOkFileNeeded() |
||
| 860 | |||
| 861 | /** |
||
| 862 | * Return's the default store. |
||
| 863 | * |
||
| 864 | * @return array The default store |
||
| 865 | */ |
||
| 866 | public function getDefaultStore() |
||
| 870 | |||
| 871 | /** |
||
| 872 | * Return's the default store view code. |
||
| 873 | * |
||
| 874 | * @return array The default store view code |
||
| 875 | */ |
||
| 876 | public function getDefaultStoreViewCode() |
||
| 880 | |||
| 881 | /** |
||
| 882 | * Set's the store view code the create the product/attributes for. |
||
| 883 | * |
||
| 884 | * @param string $storeViewCode The store view code |
||
| 885 | * |
||
| 886 | * @return void |
||
| 887 | */ |
||
| 888 | public function setStoreViewCode($storeViewCode) |
||
| 892 | |||
| 893 | /** |
||
| 894 | * Return's the store view code the create the product/attributes for. |
||
| 895 | * |
||
| 896 | * @param string|null $default The default value to return, if the store view code has not been set |
||
| 897 | * |
||
| 898 | * @return string The store view code |
||
| 899 | */ |
||
| 900 | public function getStoreViewCode($default = null) |
||
| 917 | |||
| 918 | /** |
||
| 919 | * Prepare's the store view code in the subject. If the store_view_code row doesn't contain |
||
| 920 | * any value, the default code of the default store view will be set. |
||
| 921 | * |
||
| 922 | * @return void |
||
| 923 | */ |
||
| 924 | public function prepareStoreViewCode() |
||
| 935 | |||
| 936 | /** |
||
| 937 | * Return's the store ID of the store with the passed store view code |
||
| 938 | * |
||
| 939 | * @param string $storeViewCode The store view code to return the store ID for |
||
| 940 | * |
||
| 941 | * @return integer The ID of the store with the passed ID |
||
| 942 | * @throws \Exception Is thrown, if the store with the actual code is not available |
||
| 943 | */ |
||
| 944 | public function getStoreId($storeViewCode) |
||
| 962 | |||
| 963 | /** |
||
| 964 | * Return's the store ID of the actual row, or of the default store |
||
| 965 | * if no store view code is set in the CSV file. |
||
| 966 | * |
||
| 967 | * @param string|null $default The default store view code to use, if no store view code is set in the CSV file |
||
| 968 | * |
||
| 969 | * @return integer The ID of the actual store |
||
| 970 | * @throws \Exception Is thrown, if the store with the actual code is not available |
||
| 971 | */ |
||
| 972 | public function getRowStoreId($default = null) |
||
| 983 | |||
| 984 | /** |
||
| 985 | * Return's the root category for the actual view store. |
||
| 986 | * |
||
| 987 | * @return array The store's root category |
||
| 988 | * @throws \Exception Is thrown if the root category for the passed store code is NOT available |
||
| 989 | */ |
||
| 990 | public function getRootCategory() |
||
| 1004 | |||
| 1005 | /** |
||
| 1006 | * Return's the Magento configuration value. |
||
| 1007 | * |
||
| 1008 | * @param string $path The Magento path of the requested configuration value |
||
| 1009 | * @param mixed $default The default value that has to be returned, if the requested configuration value is not set |
||
| 1010 | * @param string $scope The scope the configuration value has been set |
||
| 1011 | * @param integer $scopeId The scope ID the configuration value has been set |
||
| 1012 | * |
||
| 1013 | * @return mixed The configuration value |
||
| 1014 | * @throws \Exception Is thrown, if nor a value can be found or a default value has been passed |
||
| 1015 | */ |
||
| 1016 | public function getCoreConfigData($path, $default = null, $scope = ScopeKeys::SCOPE_DEFAULT, $scopeId = 0) |
||
| 1092 | |||
| 1093 | /** |
||
| 1094 | * Resolve the original column name for the passed one. |
||
| 1095 | * |
||
| 1096 | * @param string $columnName The column name that has to be resolved |
||
| 1097 | * |
||
| 1098 | * @return string|null The original column name |
||
| 1099 | */ |
||
| 1100 | public function resolveOriginalColumnName($columnName) |
||
| 1122 | |||
| 1123 | /** |
||
| 1124 | * Return's the original data if available, or an empty array. |
||
| 1125 | * |
||
| 1126 | * @return array The original data |
||
| 1127 | */ |
||
| 1128 | public function getOriginalData() |
||
| 1143 | |||
| 1144 | /** |
||
| 1145 | * Query's whether or not the actual column contains original data like |
||
| 1146 | * filename, line number and column names. |
||
| 1147 | * |
||
| 1148 | * @return boolean TRUE if the actual column contains origin data, else FALSE |
||
| 1149 | */ |
||
| 1150 | public function hasOriginalData() |
||
| 1154 | |||
| 1155 | /** |
||
| 1156 | * Wraps the passed exeception into a new one by trying to resolve the original filname, |
||
| 1157 | * line number and column names and use it for a detailed exception message. |
||
| 1158 | * |
||
| 1159 | * @param array $columnNames The column names that should be resolved and wrapped |
||
| 1160 | * @param \Exception $parent The exception we want to wrap |
||
| 1161 | * @param string $className The class name of the exception type we want to wrap the parent one |
||
| 1162 | * |
||
| 1163 | * @return \Exception the wrapped exception |
||
| 1164 | */ |
||
| 1165 | public function wrapException( |
||
| 1209 | |||
| 1210 | /** |
||
| 1211 | * Strip's the exception suffix containing filename and line number from the |
||
| 1212 | * passed message. |
||
| 1213 | * |
||
| 1214 | * @param string $message The message to strip the exception suffix from |
||
| 1215 | * |
||
| 1216 | * @return mixed The message without the exception suffix |
||
| 1217 | */ |
||
| 1218 | public function stripExceptionSuffix($message) |
||
| 1222 | |||
| 1223 | /** |
||
| 1224 | * Append's the exception suffix containing filename and line number to the |
||
| 1225 | * passed message. If no message has been passed, only the suffix will be |
||
| 1226 | * returned |
||
| 1227 | * |
||
| 1228 | * @param string|null $message The message to append the exception suffix to |
||
| 1229 | * @param string|null $filename The filename used to create the suffix |
||
| 1230 | * @param string|null $lineNumber The line number used to create the suffx |
||
| 1231 | * |
||
| 1232 | * @return string The message with the appended exception suffix |
||
| 1233 | */ |
||
| 1234 | public function appendExceptionSuffix($message = null, $filename = null, $lineNumber = null) |
||
| 1255 | |||
| 1256 | /** |
||
| 1257 | * Raises the value for the counter with the passed key by one. |
||
| 1258 | * |
||
| 1259 | * @param mixed $counterName The name of the counter to raise |
||
| 1260 | * |
||
| 1261 | * @return integer The counter's new value |
||
| 1262 | */ |
||
| 1263 | public function raiseCounter($counterName) |
||
| 1272 | |||
| 1273 | /** |
||
| 1274 | * Merge the passed array into the status of the actual import. |
||
| 1275 | * |
||
| 1276 | * @param array $status The status information to be merged |
||
| 1277 | * |
||
| 1278 | * @return void |
||
| 1279 | */ |
||
| 1280 | public function mergeAttributesRecursive(array $status) |
||
| 1289 | |||
| 1290 | /** |
||
| 1291 | * Return's the entity type code to be used. |
||
| 1292 | * |
||
| 1293 | * @return string The entity type code to be used |
||
| 1294 | */ |
||
| 1295 | public function getEntityTypeCode() |
||
| 1309 | } |
||
| 1310 |
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..