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 | 82 | public function __construct( |
|
| 261 | |||
| 262 | /** |
||
| 263 | * Return's the event emitter instance. |
||
| 264 | * |
||
| 265 | * @return \League\Event\EmitterInterface The event emitter instance |
||
| 266 | */ |
||
| 267 | 9 | 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 | 13 | public function setFilename($filename) |
|
| 283 | |||
| 284 | /** |
||
| 285 | * Return's the name of the file to import. |
||
| 286 | * |
||
| 287 | * @return string The filename |
||
| 288 | */ |
||
| 289 | 14 | 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 | 1 | public function setLineNumber($lineNumber) |
|
| 305 | |||
| 306 | /** |
||
| 307 | * Return's the actual line number. |
||
| 308 | * |
||
| 309 | * @return integer The line number |
||
| 310 | */ |
||
| 311 | 9 | public function getLineNumber() |
|
| 315 | |||
| 316 | /** |
||
| 317 | * Return's the default callback mappings. |
||
| 318 | * |
||
| 319 | * @return array The default callback mappings |
||
| 320 | */ |
||
| 321 | 1 | 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 | 1 | public function isDebugMode() |
|
| 362 | |||
| 363 | /** |
||
| 364 | * Return's the subject's execution context configuration. |
||
| 365 | * |
||
| 366 | * @return \TechDivision\Import\ExecutionContextInterface 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 | 82 | 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 | 82 | 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 | 1 | 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 | 1 | 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 | 82 | 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 | 9 | 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 | 2 | 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 | 1 | 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 | 1 | 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 | 82 | 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 | 1 | public function tearDown($serial) |
|
| 553 | |||
| 554 | /** |
||
| 555 | * Return's the target directory for the artefact export. |
||
| 556 | * |
||
| 557 | * @return string The target directory for the artefact export |
||
| 558 | */ |
||
| 559 | 1 | View Code Duplication | public function getTargetDir() |
| 573 | |||
| 574 | /** |
||
| 575 | * Register the passed observer with the specific type. |
||
| 576 | * |
||
| 577 | * @param \TechDivision\Import\Observers\ObserverInterface $observer The observer to register |
||
| 578 | * @param string $type The type to register the observer with |
||
| 579 | * |
||
| 580 | * @return void |
||
| 581 | */ |
||
| 582 | 6 | public function registerObserver(ObserverInterface $observer, $type) |
|
| 594 | |||
| 595 | /** |
||
| 596 | * Register the passed callback with the specific type. |
||
| 597 | * |
||
| 598 | * @param \TechDivision\Import\Callbacks\CallbackInterface $callback The subject to register the callbacks for |
||
| 599 | * @param string $type The type to register the callback with |
||
| 600 | * |
||
| 601 | * @return void |
||
| 602 | */ |
||
| 603 | 2 | public function registerCallback(CallbackInterface $callback, $type) |
|
| 615 | |||
| 616 | /** |
||
| 617 | * Return's the array with callbacks for the passed type. |
||
| 618 | * |
||
| 619 | * @param string $type The type of the callbacks to return |
||
| 620 | * |
||
| 621 | * @return array The callbacks |
||
| 622 | */ |
||
| 623 | 1 | public function getCallbacksByType($type) |
|
| 637 | |||
| 638 | /** |
||
| 639 | * Return's the array with the available observers. |
||
| 640 | * |
||
| 641 | * @return array The observers |
||
| 642 | */ |
||
| 643 | 6 | public function getObservers() |
|
| 647 | |||
| 648 | /** |
||
| 649 | * Return's the array with the available callbacks. |
||
| 650 | * |
||
| 651 | * @return array The callbacks |
||
| 652 | */ |
||
| 653 | 1 | public function getCallbacks() |
|
| 657 | |||
| 658 | /** |
||
| 659 | * Return's the callback mappings for this subject. |
||
| 660 | * |
||
| 661 | * @return array The array with the subject's callback mappings |
||
| 662 | */ |
||
| 663 | 2 | public function getCallbackMappings() |
|
| 667 | |||
| 668 | /** |
||
| 669 | * Imports the content of the file with the passed filename. |
||
| 670 | * |
||
| 671 | * |
||
| 672 | * @param string $serial The serial of the actual import |
||
| 673 | * @param string $filename The filename to process |
||
| 674 | * |
||
| 675 | * @return void |
||
| 676 | * @throws \Exception Is thrown, if the import can't be processed |
||
| 677 | */ |
||
| 678 | 2 | public function import($serial, $filename) |
|
| 754 | |||
| 755 | /** |
||
| 756 | * Imports the passed row into the database. If the import failed, the exception |
||
| 757 | * will be catched and logged, but the import process will be continued. |
||
| 758 | * |
||
| 759 | * @param array $row The row with the data to be imported |
||
| 760 | * |
||
| 761 | * @return void |
||
| 762 | */ |
||
| 763 | 7 | public function importRow(array $row) |
|
| 846 | |||
| 847 | /** |
||
| 848 | * Queries whether or not that the subject needs an OK file to be processed. |
||
| 849 | * |
||
| 850 | * @return boolean TRUE if the subject needs an OK file, else FALSE |
||
| 851 | */ |
||
| 852 | 1 | public function isOkFileNeeded() |
|
| 856 | |||
| 857 | /** |
||
| 858 | * Return's the default store. |
||
| 859 | * |
||
| 860 | * @return array The default store |
||
| 861 | */ |
||
| 862 | public function getDefaultStore() |
||
| 866 | |||
| 867 | /** |
||
| 868 | * Return's the default store view code. |
||
| 869 | * |
||
| 870 | * @return array The default store view code |
||
| 871 | */ |
||
| 872 | 4 | public function getDefaultStoreViewCode() |
|
| 876 | |||
| 877 | /** |
||
| 878 | * Set's the store view code the create the product/attributes for. |
||
| 879 | * |
||
| 880 | * @param string $storeViewCode The store view code |
||
| 881 | * |
||
| 882 | * @return void |
||
| 883 | */ |
||
| 884 | 3 | public function setStoreViewCode($storeViewCode) |
|
| 888 | |||
| 889 | /** |
||
| 890 | * Return's the store view code the create the product/attributes for. |
||
| 891 | * |
||
| 892 | * @param string|null $default The default value to return, if the store view code has not been set |
||
| 893 | * |
||
| 894 | * @return string The store view code |
||
| 895 | */ |
||
| 896 | 6 | public function getStoreViewCode($default = null) |
|
| 913 | |||
| 914 | /** |
||
| 915 | * Prepare's the store view code in the subject. If the store_view_code row doesn't contain |
||
| 916 | * any value, the default code of the default store view will be set. |
||
| 917 | * |
||
| 918 | * @return void |
||
| 919 | */ |
||
| 920 | 1 | public function prepareStoreViewCode() |
|
| 931 | |||
| 932 | /** |
||
| 933 | * Return's the store ID of the store with the passed store view code |
||
| 934 | * |
||
| 935 | * @param string $storeViewCode The store view code to return the store ID for |
||
| 936 | * |
||
| 937 | * @return integer The ID of the store with the passed ID |
||
| 938 | * @throws \Exception Is thrown, if the store with the actual code is not available |
||
| 939 | */ |
||
| 940 | 2 | public function getStoreId($storeViewCode) |
|
| 958 | |||
| 959 | /** |
||
| 960 | * Return's the store ID of the actual row, or of the default store |
||
| 961 | * if no store view code is set in the CSV file. |
||
| 962 | * |
||
| 963 | * @param string|null $default The default store view code to use, if no store view code is set in the CSV file |
||
| 964 | * |
||
| 965 | * @return integer The ID of the actual store |
||
| 966 | * @throws \Exception Is thrown, if the store with the actual code is not available |
||
| 967 | */ |
||
| 968 | 1 | public function getRowStoreId($default = null) |
|
| 979 | |||
| 980 | /** |
||
| 981 | * Return's the root category for the actual view store. |
||
| 982 | * |
||
| 983 | * @return array The store's root category |
||
| 984 | * @throws \Exception Is thrown if the root category for the passed store code is NOT available |
||
| 985 | */ |
||
| 986 | 2 | public function getRootCategory() |
|
| 1000 | |||
| 1001 | /** |
||
| 1002 | * Return's the Magento configuration value. |
||
| 1003 | * |
||
| 1004 | * @param string $path The Magento path of the requested configuration value |
||
| 1005 | * @param mixed $default The default value that has to be returned, if the requested configuration value is not set |
||
| 1006 | * @param string $scope The scope the configuration value has been set |
||
| 1007 | * @param integer $scopeId The scope ID the configuration value has been set |
||
| 1008 | * |
||
| 1009 | * @return mixed The configuration value |
||
| 1010 | * @throws \Exception Is thrown, if nor a value can be found or a default value has been passed |
||
| 1011 | */ |
||
| 1012 | 5 | public function getCoreConfigData($path, $default = null, $scope = ScopeKeys::SCOPE_DEFAULT, $scopeId = 0) |
|
| 1088 | |||
| 1089 | /** |
||
| 1090 | * Resolve the original column name for the passed one. |
||
| 1091 | * |
||
| 1092 | * @param string $columnName The column name that has to be resolved |
||
| 1093 | * |
||
| 1094 | * @return string|null The original column name |
||
| 1095 | */ |
||
| 1096 | 1 | public function resolveOriginalColumnName($columnName) |
|
| 1118 | |||
| 1119 | /** |
||
| 1120 | * Return's the original data if available, or an empty array. |
||
| 1121 | * |
||
| 1122 | * @return array The original data |
||
| 1123 | */ |
||
| 1124 | 1 | public function getOriginalData() |
|
| 1139 | |||
| 1140 | /** |
||
| 1141 | * Query's whether or not the actual column contains original data like |
||
| 1142 | * filename, line number and column names. |
||
| 1143 | * |
||
| 1144 | * @return boolean TRUE if the actual column contains origin data, else FALSE |
||
| 1145 | */ |
||
| 1146 | 1 | public function hasOriginalData() |
|
| 1150 | |||
| 1151 | /** |
||
| 1152 | * Wraps the passed exeception into a new one by trying to resolve the original filname, |
||
| 1153 | * line number and column names and use it for a detailed exception message. |
||
| 1154 | * |
||
| 1155 | * @param array $columnNames The column names that should be resolved and wrapped |
||
| 1156 | * @param \Exception $parent The exception we want to wrap |
||
| 1157 | * @param string $className The class name of the exception type we want to wrap the parent one |
||
| 1158 | * |
||
| 1159 | * @return \Exception the wrapped exception |
||
| 1160 | */ |
||
| 1161 | public function wrapException( |
||
| 1205 | |||
| 1206 | /** |
||
| 1207 | * Strip's the exception suffix containing filename and line number from the |
||
| 1208 | * passed message. |
||
| 1209 | * |
||
| 1210 | * @param string $message The message to strip the exception suffix from |
||
| 1211 | * |
||
| 1212 | * @return mixed The message without the exception suffix |
||
| 1213 | */ |
||
| 1214 | public function stripExceptionSuffix($message) |
||
| 1218 | |||
| 1219 | /** |
||
| 1220 | * Append's the exception suffix containing filename and line number to the |
||
| 1221 | * passed message. If no message has been passed, only the suffix will be |
||
| 1222 | * returned |
||
| 1223 | * |
||
| 1224 | * @param string|null $message The message to append the exception suffix to |
||
| 1225 | * @param string|null $filename The filename used to create the suffix |
||
| 1226 | * @param string|null $lineNumber The line number used to create the suffx |
||
| 1227 | * |
||
| 1228 | * @return string The message with the appended exception suffix |
||
| 1229 | */ |
||
| 1230 | 8 | public function appendExceptionSuffix($message = null, $filename = null, $lineNumber = null) |
|
| 1251 | |||
| 1252 | /** |
||
| 1253 | * Raises the value for the counter with the passed key by one. |
||
| 1254 | * |
||
| 1255 | * @param mixed $counterName The name of the counter to raise |
||
| 1256 | * |
||
| 1257 | * @return integer The counter's new value |
||
| 1258 | */ |
||
| 1259 | 1 | public function raiseCounter($counterName) |
|
| 1268 | |||
| 1269 | /** |
||
| 1270 | * Merge the passed array into the status of the actual import. |
||
| 1271 | * |
||
| 1272 | * @param array $status The status information to be merged |
||
| 1273 | * |
||
| 1274 | * @return void |
||
| 1275 | */ |
||
| 1276 | 1 | public function mergeAttributesRecursive(array $status) |
|
| 1285 | |||
| 1286 | /** |
||
| 1287 | * Return's the entity type code to be used. |
||
| 1288 | * |
||
| 1289 | * @return string The entity type code to be used |
||
| 1290 | */ |
||
| 1291 | public function getEntityTypeCode() |
||
| 1305 | } |
||
| 1306 |
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..