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 name of the file to be imported. |
||
| 92 | * |
||
| 93 | * @var string |
||
| 94 | */ |
||
| 95 | protected $filename; |
||
| 96 | |||
| 97 | /** |
||
| 98 | * The actual line number. |
||
| 99 | * |
||
| 100 | * @var integer |
||
| 101 | */ |
||
| 102 | protected $lineNumber = 0; |
||
| 103 | |||
| 104 | /** |
||
| 105 | * The import adapter instance. |
||
| 106 | * |
||
| 107 | * @var \TechDivision\Import\Adapter\ImportAdapterInterface |
||
| 108 | */ |
||
| 109 | protected $importAdapter; |
||
| 110 | |||
| 111 | /** |
||
| 112 | * The subject configuration. |
||
| 113 | * |
||
| 114 | * @var \TechDivision\Import\Configuration\SubjectConfigurationInterface |
||
| 115 | */ |
||
| 116 | protected $configuration; |
||
| 117 | |||
| 118 | /** |
||
| 119 | * The plugin configuration. |
||
| 120 | * |
||
| 121 | * @var \TechDivision\Import\Configuration\PluginConfigurationInterface |
||
| 122 | */ |
||
| 123 | protected $pluginConfiguration; |
||
| 124 | |||
| 125 | /** |
||
| 126 | * The RegistryProcessor instance to handle running threads. |
||
| 127 | * |
||
| 128 | * @var \TechDivision\Import\Services\RegistryProcessorInterface |
||
| 129 | */ |
||
| 130 | protected $registryProcessor; |
||
| 131 | |||
| 132 | /** |
||
| 133 | * The actions unique serial. |
||
| 134 | * |
||
| 135 | * @var string |
||
| 136 | */ |
||
| 137 | protected $serial; |
||
| 138 | |||
| 139 | /** |
||
| 140 | * Array with the subject's observers. |
||
| 141 | * |
||
| 142 | * @var array |
||
| 143 | */ |
||
| 144 | protected $observers = array(); |
||
| 145 | |||
| 146 | /** |
||
| 147 | * Array with the subject's callbacks. |
||
| 148 | * |
||
| 149 | * @var array |
||
| 150 | */ |
||
| 151 | protected $callbacks = array(); |
||
| 152 | |||
| 153 | /** |
||
| 154 | * The subject's callback mappings. |
||
| 155 | * |
||
| 156 | * @var array |
||
| 157 | */ |
||
| 158 | protected $callbackMappings = array(); |
||
| 159 | |||
| 160 | /** |
||
| 161 | * The available root categories. |
||
| 162 | * |
||
| 163 | * @var array |
||
| 164 | */ |
||
| 165 | protected $rootCategories = array(); |
||
| 166 | |||
| 167 | /** |
||
| 168 | * The Magento configuration. |
||
| 169 | * |
||
| 170 | * @var array |
||
| 171 | */ |
||
| 172 | protected $coreConfigData = array(); |
||
| 173 | |||
| 174 | /** |
||
| 175 | * The available stores. |
||
| 176 | * |
||
| 177 | * @var array |
||
| 178 | */ |
||
| 179 | protected $stores = array(); |
||
| 180 | |||
| 181 | /** |
||
| 182 | * The available websites. |
||
| 183 | * |
||
| 184 | * @var array |
||
| 185 | */ |
||
| 186 | protected $storeWebsites = array(); |
||
| 187 | |||
| 188 | /** |
||
| 189 | * The default store. |
||
| 190 | * |
||
| 191 | * @var array |
||
| 192 | */ |
||
| 193 | protected $defaultStore; |
||
| 194 | |||
| 195 | /** |
||
| 196 | * The store view code the create the product/attributes for. |
||
| 197 | * |
||
| 198 | * @var string |
||
| 199 | */ |
||
| 200 | protected $storeViewCode; |
||
| 201 | |||
| 202 | /** |
||
| 203 | * The UID generator for the core config data. |
||
| 204 | * |
||
| 205 | * @var \TechDivision\Import\Utils\Generators\GeneratorInterface |
||
| 206 | */ |
||
| 207 | protected $coreConfigDataUidGenerator; |
||
| 208 | |||
| 209 | /** |
||
| 210 | * UNIX timestamp with the date the last row counter has been logged. |
||
| 211 | * |
||
| 212 | * @var integer |
||
| 213 | */ |
||
| 214 | protected $lastLog = 0; |
||
| 215 | |||
| 216 | /** |
||
| 217 | * The number of the last line that has been logged with the row counter |
||
| 218 | * @var integer |
||
| 219 | */ |
||
| 220 | protected $lastLineNumber = 0; |
||
| 221 | |||
| 222 | /** |
||
| 223 | * The event emitter instance. |
||
| 224 | * |
||
| 225 | * @var \League\Event\EmitterInterface |
||
| 226 | */ |
||
| 227 | protected $emitter; |
||
| 228 | |||
| 229 | /** |
||
| 230 | * Mapping for the virtual entity type code to the real Magento 2 EAV entity type code. |
||
| 231 | * |
||
| 232 | * @var array |
||
| 233 | */ |
||
| 234 | protected $entityTypeCodeMappings = array( |
||
| 235 | EntityTypeCodes::EAV_ATTRIBUTE => EntityTypeCodes::CATALOG_PRODUCT, |
||
| 236 | EntityTypeCodes::EAV_ATTRIBUTE_SET => EntityTypeCodes::CATALOG_PRODUCT, |
||
| 237 | EntityTypeCodes::CATALOG_PRODUCT_PRICE => EntityTypeCodes::CATALOG_PRODUCT, |
||
| 238 | EntityTypeCodes::CATALOG_PRODUCT_INVENTORY => EntityTypeCodes::CATALOG_PRODUCT, |
||
| 239 | EntityTypeCodes::CATALOG_PRODUCT_INVENTORY_MSI => EntityTypeCodes::CATALOG_PRODUCT, |
||
| 240 | EntityTypeCodes::CATALOG_PRODUCT_TIER_PRICE => EntityTypeCodes::CATALOG_PRODUCT |
||
| 241 | ); |
||
| 242 | |||
| 243 | /** |
||
| 244 | * Initialize the subject instance. |
||
| 245 | * |
||
| 246 | * @param \TechDivision\Import\Services\RegistryProcessorInterface $registryProcessor The registry processor instance |
||
| 247 | * @param \TechDivision\Import\Utils\Generators\GeneratorInterface $coreConfigDataUidGenerator The UID generator for the core config data |
||
| 248 | * @param \Doctrine\Common\Collections\Collection $systemLoggers The array with the system loggers instances |
||
| 249 | * @param \League\Event\EmitterInterface $emitter The event emitter instance |
||
| 250 | */ |
||
| 251 | public function __construct( |
||
| 262 | |||
| 263 | /** |
||
| 264 | * Return's the event emitter instance. |
||
| 265 | * |
||
| 266 | * @return \League\Event\EmitterInterface The event emitter instance |
||
| 267 | */ |
||
| 268 | public function getEmitter() |
||
| 272 | |||
| 273 | /** |
||
| 274 | * Set's the name of the file to import |
||
| 275 | * |
||
| 276 | * @param string $filename The filename |
||
| 277 | * |
||
| 278 | * @return void |
||
| 279 | */ |
||
| 280 | public function setFilename($filename) |
||
| 284 | |||
| 285 | /** |
||
| 286 | * Return's the name of the file to import. |
||
| 287 | * |
||
| 288 | * @return string The filename |
||
| 289 | */ |
||
| 290 | public function getFilename() |
||
| 294 | |||
| 295 | /** |
||
| 296 | * Set's the actual line number. |
||
| 297 | * |
||
| 298 | * @param integer $lineNumber The line number |
||
| 299 | * |
||
| 300 | * @return void |
||
| 301 | */ |
||
| 302 | public function setLineNumber($lineNumber) |
||
| 306 | |||
| 307 | /** |
||
| 308 | * Return's the actual line number. |
||
| 309 | * |
||
| 310 | * @return integer The line number |
||
| 311 | */ |
||
| 312 | public function getLineNumber() |
||
| 316 | |||
| 317 | /** |
||
| 318 | * Return's the default callback mappings. |
||
| 319 | * |
||
| 320 | * @return array The default callback mappings |
||
| 321 | */ |
||
| 322 | public function getDefaultCallbackMappings() |
||
| 326 | |||
| 327 | /** |
||
| 328 | * Tries to format the passed value to a valid date with format 'Y-m-d H:i:s'. |
||
| 329 | * If the passed value is NOT a valid date, NULL will be returned. |
||
| 330 | * |
||
| 331 | * @param string $value The value to format |
||
| 332 | * |
||
| 333 | * @return string|null The formatted date or NULL if the date is not valid |
||
| 334 | */ |
||
| 335 | public function formatDate($value) |
||
| 339 | |||
| 340 | /** |
||
| 341 | * Extracts the elements of the passed value by exploding them |
||
| 342 | * with the also passed delimiter. |
||
| 343 | * |
||
| 344 | * @param string $value The value to extract |
||
| 345 | * @param string|null $delimiter The delimiter used to extrace the elements |
||
| 346 | * |
||
| 347 | * @return array The exploded values |
||
| 348 | */ |
||
| 349 | public function explode($value, $delimiter = null) |
||
| 353 | |||
| 354 | /** |
||
| 355 | * Queries whether or not debug mode is enabled or not, default is TRUE. |
||
| 356 | * |
||
| 357 | * @return boolean TRUE if debug mode is enabled, else FALSE |
||
| 358 | */ |
||
| 359 | public function isDebugMode() |
||
| 363 | |||
| 364 | /** |
||
| 365 | * Return's the subject's execution context configuration. |
||
| 366 | * |
||
| 367 | * @return \TechDivision\Import\ExecutionContextInterface The execution context configuration to use |
||
| 368 | */ |
||
| 369 | public function getExecutionContext() |
||
| 373 | |||
| 374 | /** |
||
| 375 | * Set's the subject configuration. |
||
| 376 | * |
||
| 377 | * @param \TechDivision\Import\Configuration\SubjectConfigurationInterface $configuration The subject configuration |
||
| 378 | * |
||
| 379 | * @return void |
||
| 380 | */ |
||
| 381 | public function setConfiguration(SubjectConfigurationInterface $configuration) |
||
| 385 | |||
| 386 | /** |
||
| 387 | * Return's the subject configuration. |
||
| 388 | * |
||
| 389 | * @return \TechDivision\Import\Configuration\SubjectConfigurationInterface The subject configuration |
||
| 390 | */ |
||
| 391 | public function getConfiguration() |
||
| 395 | |||
| 396 | /** |
||
| 397 | * Set's the import adapter instance. |
||
| 398 | * |
||
| 399 | * @param \TechDivision\Import\Adapter\ImportAdapterInterface $importAdapter The import adapter instance |
||
| 400 | * |
||
| 401 | * @return void |
||
| 402 | */ |
||
| 403 | public function setImportAdapter(ImportAdapterInterface $importAdapter) |
||
| 407 | |||
| 408 | /** |
||
| 409 | * Return's the import adapter instance. |
||
| 410 | * |
||
| 411 | * @return \TechDivision\Import\Adapter\ImportAdapterInterface The import adapter instance |
||
| 412 | */ |
||
| 413 | public function getImportAdapter() |
||
| 417 | |||
| 418 | /** |
||
| 419 | * Return's the RegistryProcessor instance to handle the running threads. |
||
| 420 | * |
||
| 421 | * @return \TechDivision\Import\Services\RegistryProcessorInterface The registry processor instance |
||
| 422 | */ |
||
| 423 | public function getRegistryProcessor() |
||
| 427 | |||
| 428 | /** |
||
| 429 | * Set's the unique serial for this import process. |
||
| 430 | * |
||
| 431 | * @param string $serial The unique serial |
||
| 432 | * |
||
| 433 | * @return void |
||
| 434 | */ |
||
| 435 | public function setSerial($serial) |
||
| 439 | |||
| 440 | /** |
||
| 441 | * Return's the unique serial for this import process. |
||
| 442 | * |
||
| 443 | * @return string The unique serial |
||
| 444 | */ |
||
| 445 | public function getSerial() |
||
| 449 | |||
| 450 | /** |
||
| 451 | * Return's the source date format to use. |
||
| 452 | * |
||
| 453 | * @return string The source date format |
||
| 454 | */ |
||
| 455 | public function getSourceDateFormat() |
||
| 459 | |||
| 460 | /** |
||
| 461 | * Return's the multiple field delimiter character to use, default value is comma (,). |
||
| 462 | * |
||
| 463 | * @return string The multiple field delimiter character |
||
| 464 | */ |
||
| 465 | public function getMultipleFieldDelimiter() |
||
| 469 | |||
| 470 | /** |
||
| 471 | * Return's the multiple value delimiter character to use, default value is comma (|). |
||
| 472 | * |
||
| 473 | * @return string The multiple value delimiter character |
||
| 474 | */ |
||
| 475 | public function getMultipleValueDelimiter() |
||
| 479 | |||
| 480 | /** |
||
| 481 | * Intializes the previously loaded global data for exactly one bunch. |
||
| 482 | * |
||
| 483 | * @param string $serial The serial of the actual import |
||
| 484 | * |
||
| 485 | * @return void |
||
| 486 | */ |
||
| 487 | public function setUp($serial) |
||
| 527 | |||
| 528 | /** |
||
| 529 | * Clean up the global data after importing the variants. |
||
| 530 | * |
||
| 531 | * @param string $serial The serial of the actual import |
||
| 532 | * |
||
| 533 | * @return void |
||
| 534 | */ |
||
| 535 | 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 | View Code Duplication | public function getTargetDir() |
|
| 574 | |||
| 575 | /** |
||
| 576 | * Register the passed observer with the specific type. |
||
| 577 | * |
||
| 578 | * @param \TechDivision\Import\Observers\ObserverInterface $observer The observer to register |
||
| 579 | * @param string $type The type to register the observer with |
||
| 580 | * |
||
| 581 | * @return void |
||
| 582 | */ |
||
| 583 | public function registerObserver(ObserverInterface $observer, $type) |
||
| 595 | |||
| 596 | /** |
||
| 597 | * Register the passed callback with the specific type. |
||
| 598 | * |
||
| 599 | * @param \TechDivision\Import\Callbacks\CallbackInterface $callback The subject to register the callbacks for |
||
| 600 | * @param string $type The type to register the callback with |
||
| 601 | * |
||
| 602 | * @return void |
||
| 603 | */ |
||
| 604 | public function registerCallback(CallbackInterface $callback, $type) |
||
| 616 | |||
| 617 | /** |
||
| 618 | * Return's the array with callbacks for the passed type. |
||
| 619 | * |
||
| 620 | * @param string $type The type of the callbacks to return |
||
| 621 | * |
||
| 622 | * @return array The callbacks |
||
| 623 | */ |
||
| 624 | public function getCallbacksByType($type) |
||
| 638 | |||
| 639 | /** |
||
| 640 | * Return's the array with the available observers. |
||
| 641 | * |
||
| 642 | * @return array The observers |
||
| 643 | */ |
||
| 644 | public function getObservers() |
||
| 648 | |||
| 649 | /** |
||
| 650 | * Return's the array with the available callbacks. |
||
| 651 | * |
||
| 652 | * @return array The callbacks |
||
| 653 | */ |
||
| 654 | public function getCallbacks() |
||
| 658 | |||
| 659 | /** |
||
| 660 | * Return's the callback mappings for this subject. |
||
| 661 | * |
||
| 662 | * @return array The array with the subject's callback mappings |
||
| 663 | */ |
||
| 664 | public function getCallbackMappings() |
||
| 668 | |||
| 669 | /** |
||
| 670 | * Imports the content of the file with the passed filename. |
||
| 671 | * |
||
| 672 | * |
||
| 673 | * @param string $serial The serial of the actual import |
||
| 674 | * @param string $filename The filename to process |
||
| 675 | * |
||
| 676 | * @return void |
||
| 677 | * @throws \Exception Is thrown, if the import can't be processed |
||
| 678 | */ |
||
| 679 | public function import($serial, $filename) |
||
| 755 | |||
| 756 | /** |
||
| 757 | * Imports the passed row into the database. If the import failed, the exception |
||
| 758 | * will be catched and logged, but the import process will be continued. |
||
| 759 | * |
||
| 760 | * @param array $row The row with the data to be imported |
||
| 761 | * |
||
| 762 | * @return void |
||
| 763 | */ |
||
| 764 | public function importRow(array $row) |
||
| 847 | |||
| 848 | /** |
||
| 849 | * Queries whether or not that the subject needs an OK file to be processed. |
||
| 850 | * |
||
| 851 | * @return boolean TRUE if the subject needs an OK file, else FALSE |
||
| 852 | */ |
||
| 853 | public function isOkFileNeeded() |
||
| 857 | |||
| 858 | /** |
||
| 859 | * Return's the default store. |
||
| 860 | * |
||
| 861 | * @return array The default store |
||
| 862 | */ |
||
| 863 | public function getDefaultStore() |
||
| 867 | |||
| 868 | /** |
||
| 869 | * Return's the default store view code. |
||
| 870 | * |
||
| 871 | * @return array The default store view code |
||
| 872 | */ |
||
| 873 | public function getDefaultStoreViewCode() |
||
| 877 | |||
| 878 | /** |
||
| 879 | * Set's the store view code the create the product/attributes for. |
||
| 880 | * |
||
| 881 | * @param string $storeViewCode The store view code |
||
| 882 | * |
||
| 883 | * @return void |
||
| 884 | */ |
||
| 885 | public function setStoreViewCode($storeViewCode) |
||
| 889 | |||
| 890 | /** |
||
| 891 | * Return's the store view code the create the product/attributes for. |
||
| 892 | * |
||
| 893 | * @param string|null $default The default value to return, if the store view code has not been set |
||
| 894 | * |
||
| 895 | * @return string The store view code |
||
| 896 | */ |
||
| 897 | public function getStoreViewCode($default = null) |
||
| 914 | |||
| 915 | /** |
||
| 916 | * Prepare's the store view code in the subject. If the store_view_code row doesn't contain |
||
| 917 | * any value, the default code of the default store view will be set. |
||
| 918 | * |
||
| 919 | * @return void |
||
| 920 | */ |
||
| 921 | public function prepareStoreViewCode() |
||
| 932 | |||
| 933 | /** |
||
| 934 | * Return's the store ID of the store with the passed store view code |
||
| 935 | * |
||
| 936 | * @param string $storeViewCode The store view code to return the store ID for |
||
| 937 | * |
||
| 938 | * @return integer The ID of the store with the passed ID |
||
| 939 | * @throws \Exception Is thrown, if the store with the actual code is not available |
||
| 940 | */ |
||
| 941 | public function getStoreId($storeViewCode) |
||
| 959 | |||
| 960 | /** |
||
| 961 | * Return's the store ID of the actual row, or of the default store |
||
| 962 | * if no store view code is set in the CSV file. |
||
| 963 | * |
||
| 964 | * @param string|null $default The default store view code to use, if no store view code is set in the CSV file |
||
| 965 | * |
||
| 966 | * @return integer The ID of the actual store |
||
| 967 | * @throws \Exception Is thrown, if the store with the actual code is not available |
||
| 968 | */ |
||
| 969 | public function getRowStoreId($default = null) |
||
| 980 | |||
| 981 | /** |
||
| 982 | * Return's the root category for the actual view store. |
||
| 983 | * |
||
| 984 | * @return array The store's root category |
||
| 985 | * @throws \Exception Is thrown if the root category for the passed store code is NOT available |
||
| 986 | */ |
||
| 987 | public function getRootCategory() |
||
| 1001 | |||
| 1002 | /** |
||
| 1003 | * Return's the Magento configuration value. |
||
| 1004 | * |
||
| 1005 | * @param string $path The Magento path of the requested configuration value |
||
| 1006 | * @param mixed $default The default value that has to be returned, if the requested configuration value is not set |
||
| 1007 | * @param string $scope The scope the configuration value has been set |
||
| 1008 | * @param integer $scopeId The scope ID the configuration value has been set |
||
| 1009 | * |
||
| 1010 | * @return mixed The configuration value |
||
| 1011 | * @throws \Exception Is thrown, if nor a value can be found or a default value has been passed |
||
| 1012 | */ |
||
| 1013 | public function getCoreConfigData($path, $default = null, $scope = ScopeKeys::SCOPE_DEFAULT, $scopeId = 0) |
||
| 1089 | |||
| 1090 | /** |
||
| 1091 | * Resolve the original column name for the passed one. |
||
| 1092 | * |
||
| 1093 | * @param string $columnName The column name that has to be resolved |
||
| 1094 | * |
||
| 1095 | * @return string|null The original column name |
||
| 1096 | */ |
||
| 1097 | public function resolveOriginalColumnName($columnName) |
||
| 1119 | |||
| 1120 | /** |
||
| 1121 | * Return's the original data if available, or an empty array. |
||
| 1122 | * |
||
| 1123 | * @return array The original data |
||
| 1124 | */ |
||
| 1125 | public function getOriginalData() |
||
| 1140 | |||
| 1141 | /** |
||
| 1142 | * Query's whether or not the actual column contains original data like |
||
| 1143 | * filename, line number and column names. |
||
| 1144 | * |
||
| 1145 | * @return boolean TRUE if the actual column contains origin data, else FALSE |
||
| 1146 | */ |
||
| 1147 | public function hasOriginalData() |
||
| 1151 | |||
| 1152 | /** |
||
| 1153 | * Wraps the passed exeception into a new one by trying to resolve the original filname, |
||
| 1154 | * line number and column names and use it for a detailed exception message. |
||
| 1155 | * |
||
| 1156 | * @param array $columnNames The column names that should be resolved and wrapped |
||
| 1157 | * @param \Exception $parent The exception we want to wrap |
||
| 1158 | * @param string $className The class name of the exception type we want to wrap the parent one |
||
| 1159 | * |
||
| 1160 | * @return \Exception the wrapped exception |
||
| 1161 | */ |
||
| 1162 | public function wrapException( |
||
| 1206 | |||
| 1207 | /** |
||
| 1208 | * Strip's the exception suffix containing filename and line number from the |
||
| 1209 | * passed message. |
||
| 1210 | * |
||
| 1211 | * @param string $message The message to strip the exception suffix from |
||
| 1212 | * |
||
| 1213 | * @return mixed The message without the exception suffix |
||
| 1214 | */ |
||
| 1215 | public function stripExceptionSuffix($message) |
||
| 1219 | |||
| 1220 | /** |
||
| 1221 | * Append's the exception suffix containing filename and line number to the |
||
| 1222 | * passed message. If no message has been passed, only the suffix will be |
||
| 1223 | * returned |
||
| 1224 | * |
||
| 1225 | * @param string|null $message The message to append the exception suffix to |
||
| 1226 | * @param string|null $filename The filename used to create the suffix |
||
| 1227 | * @param string|null $lineNumber The line number used to create the suffx |
||
| 1228 | * |
||
| 1229 | * @return string The message with the appended exception suffix |
||
| 1230 | */ |
||
| 1231 | public function appendExceptionSuffix($message = null, $filename = null, $lineNumber = null) |
||
| 1252 | |||
| 1253 | /** |
||
| 1254 | * Raises the value for the counter with the passed key by one. |
||
| 1255 | * |
||
| 1256 | * @param mixed $counterName The name of the counter to raise |
||
| 1257 | * |
||
| 1258 | * @return integer The counter's new value |
||
| 1259 | */ |
||
| 1260 | public function raiseCounter($counterName) |
||
| 1269 | |||
| 1270 | /** |
||
| 1271 | * Merge the passed array into the status of the actual import. |
||
| 1272 | * |
||
| 1273 | * @param array $status The status information to be merged |
||
| 1274 | * |
||
| 1275 | * @return void |
||
| 1276 | */ |
||
| 1277 | public function mergeAttributesRecursive(array $status) |
||
| 1286 | |||
| 1287 | /** |
||
| 1288 | * Return's the entity type code to be used. |
||
| 1289 | * |
||
| 1290 | * @return string The entity type code to be used |
||
| 1291 | */ |
||
| 1292 | public function getEntityTypeCode() |
||
| 1306 | } |
||
| 1307 |
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..