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 |
||
| 48 | abstract class AbstractSubject implements SubjectInterface |
||
| 49 | { |
||
| 50 | |||
| 51 | /** |
||
| 52 | * The trait that provides basic filesystem handling functionality. |
||
| 53 | * |
||
| 54 | * @var TechDivision\Import\Subjects\FilesystemTrait |
||
| 55 | */ |
||
| 56 | use FilesystemTrait; |
||
| 57 | |||
| 58 | /** |
||
| 59 | * The trait that provides basic filesystem handling functionality. |
||
| 60 | * |
||
| 61 | * @var TechDivision\Import\SystemLoggerTrait |
||
| 62 | */ |
||
| 63 | use SystemLoggerTrait; |
||
| 64 | |||
| 65 | /** |
||
| 66 | * The trait that provides header handling functionality. |
||
| 67 | * |
||
| 68 | * @var TechDivision\Import\HeaderTrait |
||
| 69 | */ |
||
| 70 | use HeaderTrait; |
||
| 71 | |||
| 72 | /** |
||
| 73 | * The trait that provides row handling functionality. |
||
| 74 | * |
||
| 75 | * @var TechDivision\Import\RowTrait |
||
| 76 | */ |
||
| 77 | use RowTrait; |
||
| 78 | |||
| 79 | /** |
||
| 80 | * The name of the file to be imported. |
||
| 81 | * |
||
| 82 | * @var string |
||
| 83 | */ |
||
| 84 | protected $filename; |
||
| 85 | |||
| 86 | /** |
||
| 87 | * The actual line number. |
||
| 88 | * |
||
| 89 | * @var integer |
||
| 90 | */ |
||
| 91 | protected $lineNumber = 0; |
||
| 92 | |||
| 93 | /** |
||
| 94 | * The actual operation name. |
||
| 95 | * |
||
| 96 | * @var string |
||
| 97 | */ |
||
| 98 | protected $operationName ; |
||
| 99 | |||
| 100 | /** |
||
| 101 | * The flag that stop's overserver execution on the actual row. |
||
| 102 | * |
||
| 103 | * @var boolean |
||
| 104 | */ |
||
| 105 | protected $skipRow = false; |
||
| 106 | |||
| 107 | /** |
||
| 108 | * The import adapter instance. |
||
| 109 | * |
||
| 110 | * @var \TechDivision\Import\Adapter\ImportAdapterInterface |
||
| 111 | */ |
||
| 112 | protected $importAdapter; |
||
| 113 | |||
| 114 | /** |
||
| 115 | * The system configuration. |
||
| 116 | * |
||
| 117 | * @var \TechDivision\Import\Configuration\SubjectConfigurationInterface |
||
| 118 | */ |
||
| 119 | protected $configuration; |
||
| 120 | |||
| 121 | /** |
||
| 122 | * The RegistryProcessor instance to handle running threads. |
||
| 123 | * |
||
| 124 | * @var \TechDivision\Import\Services\RegistryProcessorInterface |
||
| 125 | */ |
||
| 126 | protected $registryProcessor; |
||
| 127 | |||
| 128 | /** |
||
| 129 | * The actions unique serial. |
||
| 130 | * |
||
| 131 | * @var string |
||
| 132 | */ |
||
| 133 | protected $serial; |
||
| 134 | |||
| 135 | /** |
||
| 136 | * Array with the subject's observers. |
||
| 137 | * |
||
| 138 | * @var array |
||
| 139 | */ |
||
| 140 | protected $observers = array(); |
||
| 141 | |||
| 142 | /** |
||
| 143 | * Array with the subject's callbacks. |
||
| 144 | * |
||
| 145 | * @var array |
||
| 146 | */ |
||
| 147 | protected $callbacks = array(); |
||
| 148 | |||
| 149 | /** |
||
| 150 | * The subject's callback mappings. |
||
| 151 | * |
||
| 152 | * @var array |
||
| 153 | */ |
||
| 154 | protected $callbackMappings = array(); |
||
| 155 | |||
| 156 | /** |
||
| 157 | * The available root categories. |
||
| 158 | * |
||
| 159 | * @var array |
||
| 160 | */ |
||
| 161 | protected $rootCategories = array(); |
||
| 162 | |||
| 163 | /** |
||
| 164 | * The Magento configuration. |
||
| 165 | * |
||
| 166 | * @var array |
||
| 167 | */ |
||
| 168 | protected $coreConfigData = array(); |
||
| 169 | |||
| 170 | /** |
||
| 171 | * The available stores. |
||
| 172 | * |
||
| 173 | * @var array |
||
| 174 | */ |
||
| 175 | protected $stores = array(); |
||
| 176 | |||
| 177 | /** |
||
| 178 | * The available websites. |
||
| 179 | * |
||
| 180 | * @var array |
||
| 181 | */ |
||
| 182 | protected $storeWebsites = array(); |
||
| 183 | |||
| 184 | /** |
||
| 185 | * The default store. |
||
| 186 | * |
||
| 187 | * @var array |
||
| 188 | */ |
||
| 189 | protected $defaultStore; |
||
| 190 | |||
| 191 | /** |
||
| 192 | * The store view code the create the product/attributes for. |
||
| 193 | * |
||
| 194 | * @var string |
||
| 195 | */ |
||
| 196 | protected $storeViewCode; |
||
| 197 | |||
| 198 | /** |
||
| 199 | * The UID generator for the core config data. |
||
| 200 | * |
||
| 201 | * @var \TechDivision\Import\Utils\Generators\GeneratorInterface |
||
| 202 | */ |
||
| 203 | protected $coreConfigDataUidGenerator; |
||
| 204 | |||
| 205 | /** |
||
| 206 | * Initialize the subject instance. |
||
| 207 | * |
||
| 208 | * @param \TechDivision\Import\Services\RegistryProcessorInterface $registryProcessor The registry processor instance |
||
| 209 | * @param \TechDivision\Import\Utils\Generators\GeneratorInterface $coreConfigDataUidGenerator The UID generator for the core config data |
||
| 210 | * @param \Doctrine\Common\Collections\Collection $systemLoggers The array with the system loggers instances |
||
| 211 | */ |
||
| 212 | 77 | public function __construct( |
|
| 221 | |||
| 222 | /** |
||
| 223 | * Set's the name of the file to import |
||
| 224 | * |
||
| 225 | * @param string $filename The filename |
||
| 226 | * |
||
| 227 | * @return void |
||
| 228 | */ |
||
| 229 | 13 | public function setFilename($filename) |
|
| 233 | |||
| 234 | /** |
||
| 235 | * Return's the name of the file to import. |
||
| 236 | * |
||
| 237 | * @return string The filename |
||
| 238 | */ |
||
| 239 | 13 | public function getFilename() |
|
| 243 | |||
| 244 | /** |
||
| 245 | * Set's the actual operation name. |
||
| 246 | * |
||
| 247 | * @param string $operationName The actual operation name |
||
| 248 | * |
||
| 249 | * @return void |
||
| 250 | */ |
||
| 251 | 1 | public function setOperationName($operationName) |
|
| 255 | |||
| 256 | /** |
||
| 257 | * Return's the actual operation name. |
||
| 258 | * |
||
| 259 | * @return string |
||
| 260 | */ |
||
| 261 | 1 | public function getOperationName() |
|
| 265 | |||
| 266 | /** |
||
| 267 | * Set's the actual line number. |
||
| 268 | * |
||
| 269 | * @param integer $lineNumber The line number |
||
| 270 | * |
||
| 271 | * @return void |
||
| 272 | */ |
||
| 273 | 1 | public function setLineNumber($lineNumber) |
|
| 277 | |||
| 278 | /** |
||
| 279 | * Return's the actual line number. |
||
| 280 | * |
||
| 281 | * @return integer The line number |
||
| 282 | */ |
||
| 283 | 13 | public function getLineNumber() |
|
| 287 | |||
| 288 | /** |
||
| 289 | * Stop's observer execution on the actual row. |
||
| 290 | * |
||
| 291 | * @return void |
||
| 292 | */ |
||
| 293 | 1 | public function skipRow() |
|
| 297 | |||
| 298 | /** |
||
| 299 | * Return's the default callback mappings. |
||
| 300 | * |
||
| 301 | * @return array The default callback mappings |
||
| 302 | */ |
||
| 303 | 1 | public function getDefaultCallbackMappings() |
|
| 307 | |||
| 308 | /** |
||
| 309 | * Tries to format the passed value to a valid date with format 'Y-m-d H:i:s'. |
||
| 310 | * If the passed value is NOT a valid date, NULL will be returned. |
||
| 311 | * |
||
| 312 | * @param string $value The value to format |
||
| 313 | * |
||
| 314 | * @return string|null The formatted date or NULL if the date is not valid |
||
| 315 | */ |
||
| 316 | 2 | public function formatDate($value) |
|
| 327 | |||
| 328 | /** |
||
| 329 | * Extracts the elements of the passed value by exploding them |
||
| 330 | * with the also passed delimiter. |
||
| 331 | * |
||
| 332 | * @param string $value The value to extract |
||
| 333 | * @param string|null $delimiter The delimiter used to extrace the elements |
||
| 334 | * |
||
| 335 | * @return array The exploded values |
||
| 336 | */ |
||
| 337 | 2 | public function explode($value, $delimiter = null) |
|
| 350 | |||
| 351 | /** |
||
| 352 | * Queries whether or not debug mode is enabled or not, default is TRUE. |
||
| 353 | * |
||
| 354 | * @return boolean TRUE if debug mode is enabled, else FALSE |
||
| 355 | */ |
||
| 356 | 1 | public function isDebugMode() |
|
| 360 | |||
| 361 | /** |
||
| 362 | * Set's the subject configuration. |
||
| 363 | * |
||
| 364 | * @param \TechDivision\Import\Configuration\SubjectConfigurationInterface $configuration The subject configuration |
||
| 365 | * |
||
| 366 | * @return void |
||
| 367 | */ |
||
| 368 | 77 | public function setConfiguration(SubjectConfigurationInterface $configuration) |
|
| 372 | |||
| 373 | /** |
||
| 374 | * Return's the subject configuration. |
||
| 375 | * |
||
| 376 | * @return \TechDivision\Import\Configuration\SubjectConfigurationInterface The subject configuration |
||
| 377 | */ |
||
| 378 | 77 | public function getConfiguration() |
|
| 382 | |||
| 383 | /** |
||
| 384 | * Set's the import adapter instance. |
||
| 385 | * |
||
| 386 | * @param \TechDivision\Import\Adapter\ImportAdapterInterface $importAdapter The import adapter instance |
||
| 387 | * |
||
| 388 | * @return void |
||
| 389 | */ |
||
| 390 | 3 | public function setImportAdapter(ImportAdapterInterface $importAdapter) |
|
| 394 | |||
| 395 | /** |
||
| 396 | * Return's the import adapter instance. |
||
| 397 | * |
||
| 398 | * @return \TechDivision\Import\Adapter\ImportAdapterInterface The import adapter instance |
||
| 399 | */ |
||
| 400 | 3 | public function getImportAdapter() |
|
| 404 | |||
| 405 | /** |
||
| 406 | * Return's the RegistryProcessor instance to handle the running threads. |
||
| 407 | * |
||
| 408 | * @return \TechDivision\Import\Services\RegistryProcessorInterface The registry processor instance |
||
| 409 | */ |
||
| 410 | 77 | public function getRegistryProcessor() |
|
| 414 | |||
| 415 | /** |
||
| 416 | * Set's the unique serial for this import process. |
||
| 417 | * |
||
| 418 | * @param string $serial The unique serial |
||
| 419 | * |
||
| 420 | * @return void |
||
| 421 | */ |
||
| 422 | 9 | public function setSerial($serial) |
|
| 426 | |||
| 427 | /** |
||
| 428 | * Return's the unique serial for this import process. |
||
| 429 | * |
||
| 430 | * @return string The unique serial |
||
| 431 | */ |
||
| 432 | 4 | public function getSerial() |
|
| 436 | |||
| 437 | /** |
||
| 438 | * Return's the source date format to use. |
||
| 439 | * |
||
| 440 | * @return string The source date format |
||
| 441 | */ |
||
| 442 | 4 | public function getSourceDateFormat() |
|
| 446 | |||
| 447 | /** |
||
| 448 | * Return's the multiple field delimiter character to use, default value is comma (,). |
||
| 449 | * |
||
| 450 | * @return string The multiple field delimiter character |
||
| 451 | */ |
||
| 452 | 1 | public function getMultipleFieldDelimiter() |
|
| 456 | |||
| 457 | /** |
||
| 458 | * Return's the multiple value delimiter character to use, default value is comma (|). |
||
| 459 | * |
||
| 460 | * @return string The multiple value delimiter character |
||
| 461 | */ |
||
| 462 | 1 | public function getMultipleValueDelimiter() |
|
| 466 | |||
| 467 | /** |
||
| 468 | * Intializes the previously loaded global data for exactly one bunch. |
||
| 469 | * |
||
| 470 | * @param string $serial The serial of the actual import |
||
| 471 | * |
||
| 472 | * @return void |
||
| 473 | */ |
||
| 474 | 77 | public function setUp($serial) |
|
| 512 | |||
| 513 | /** |
||
| 514 | * Clean up the global data after importing the variants. |
||
| 515 | * |
||
| 516 | * @param string $serial The serial of the actual import |
||
| 517 | * |
||
| 518 | * @return void |
||
| 519 | */ |
||
| 520 | 1 | public function tearDown($serial) |
|
| 521 | { |
||
| 522 | |||
| 523 | // load the registry processor |
||
| 524 | 1 | $registryProcessor = $this->getRegistryProcessor(); |
|
| 525 | |||
| 526 | // update the source directory for the next subject |
||
| 527 | 1 | $registryProcessor->mergeAttributesRecursive( |
|
| 528 | 1 | $serial, |
|
| 529 | array( |
||
| 530 | 1 | RegistryKeys::SOURCE_DIRECTORY => $newSourceDir = $this->getNewSourceDir($serial), |
|
| 531 | 1 | RegistryKeys::FILES => array($this->getFilename() => array(RegistryKeys::STATUS => 1)) |
|
| 532 | ) |
||
| 533 | ); |
||
| 534 | |||
| 535 | // log a debug message with the new source directory |
||
| 536 | $this->getSystemLogger()->debug( |
||
| 537 | sprintf('Subject %s successfully updated source directory to %s', get_class($this), $newSourceDir) |
||
| 538 | ); |
||
| 539 | } |
||
| 540 | |||
| 541 | /** |
||
| 542 | * Return's the target directory for the artefact export. |
||
| 543 | * |
||
| 544 | * @return string The target directory for the artefact export |
||
| 545 | */ |
||
| 546 | 1 | public function getTargetDir() |
|
| 550 | |||
| 551 | /** |
||
| 552 | * Return's the next source directory, which will be the target directory |
||
| 553 | * of this subject, in most cases. |
||
| 554 | * |
||
| 555 | * @param string $serial The serial of the actual import |
||
| 556 | * |
||
| 557 | * @return string The new source directory |
||
| 558 | */ |
||
| 559 | 4 | public function getNewSourceDir($serial) |
|
| 563 | |||
| 564 | /** |
||
| 565 | * Register the passed observer with the specific type. |
||
| 566 | * |
||
| 567 | * @param \TechDivision\Import\Observers\ObserverInterface $observer The observer to register |
||
| 568 | * @param string $type The type to register the observer with |
||
| 569 | * |
||
| 570 | * @return void |
||
| 571 | */ |
||
| 572 | 6 | public function registerObserver(ObserverInterface $observer, $type) |
|
| 584 | |||
| 585 | /** |
||
| 586 | * Register the passed callback with the specific type. |
||
| 587 | * |
||
| 588 | * @param \TechDivision\Import\Callbacks\CallbackInterface $callback The subject to register the callbacks for |
||
| 589 | * @param string $type The type to register the callback with |
||
| 590 | * |
||
| 591 | * @return void |
||
| 592 | */ |
||
| 593 | 2 | public function registerCallback(CallbackInterface $callback, $type) |
|
| 605 | |||
| 606 | /** |
||
| 607 | * Return's the array with callbacks for the passed type. |
||
| 608 | * |
||
| 609 | * @param string $type The type of the callbacks to return |
||
| 610 | * |
||
| 611 | * @return array The callbacks |
||
| 612 | */ |
||
| 613 | 1 | public function getCallbacksByType($type) |
|
| 627 | |||
| 628 | /** |
||
| 629 | * Return's the array with the available observers. |
||
| 630 | * |
||
| 631 | * @return array The observers |
||
| 632 | */ |
||
| 633 | 6 | public function getObservers() |
|
| 637 | |||
| 638 | /** |
||
| 639 | * Return's the array with the available callbacks. |
||
| 640 | * |
||
| 641 | * @return array The callbacks |
||
| 642 | */ |
||
| 643 | 1 | public function getCallbacks() |
|
| 647 | |||
| 648 | /** |
||
| 649 | * Return's the callback mappings for this subject. |
||
| 650 | * |
||
| 651 | * @return array The array with the subject's callback mappings |
||
| 652 | */ |
||
| 653 | 2 | public function getCallbackMappings() |
|
| 657 | |||
| 658 | /** |
||
| 659 | * Imports the content of the file with the passed filename. |
||
| 660 | * |
||
| 661 | * |
||
| 662 | * @param string $serial The serial of the actual import |
||
| 663 | * @param string $filename The filename to process |
||
| 664 | * |
||
| 665 | * @return void |
||
| 666 | * @throws \Exception Is thrown, if the import can't be processed |
||
| 667 | */ |
||
| 668 | 5 | public function import($serial, $filename) |
|
| 734 | |||
| 735 | /** |
||
| 736 | * This method queries whether or not the passed filename matches |
||
| 737 | * the pattern, based on the subjects configured prefix. |
||
| 738 | * |
||
| 739 | * @param string $filename The filename to match |
||
| 740 | * |
||
| 741 | * @return boolean TRUE if the filename matches, else FALSE |
||
| 742 | */ |
||
| 743 | 5 | protected function match($filename) |
|
| 756 | |||
| 757 | /** |
||
| 758 | * Imports the passed row into the database. If the import failed, the exception |
||
| 759 | * will be catched and logged, but the import process will be continued. |
||
| 760 | * |
||
| 761 | * @param array $row The row with the data to be imported |
||
| 762 | * |
||
| 763 | * @return void |
||
| 764 | */ |
||
| 765 | 7 | public function importRow(array $row) |
|
| 821 | |||
| 822 | /** |
||
| 823 | * Queries whether or not that the subject needs an OK file to be processed. |
||
| 824 | * |
||
| 825 | * @return boolean TRUE if the subject needs an OK file, else FALSE |
||
| 826 | */ |
||
| 827 | 1 | public function isOkFileNeeded() |
|
| 831 | |||
| 832 | /** |
||
| 833 | * Return's the default store. |
||
| 834 | * |
||
| 835 | * @return array The default store |
||
| 836 | */ |
||
| 837 | public function getDefaultStore() |
||
| 841 | |||
| 842 | /** |
||
| 843 | * Return's the default store view code. |
||
| 844 | * |
||
| 845 | * @return array The default store view code |
||
| 846 | */ |
||
| 847 | 5 | public function getDefaultStoreViewCode() |
|
| 851 | |||
| 852 | /** |
||
| 853 | * Set's the store view code the create the product/attributes for. |
||
| 854 | * |
||
| 855 | * @param string $storeViewCode The store view code |
||
| 856 | * |
||
| 857 | * @return void |
||
| 858 | */ |
||
| 859 | 4 | public function setStoreViewCode($storeViewCode) |
|
| 863 | |||
| 864 | /** |
||
| 865 | * Return's the store view code the create the product/attributes for. |
||
| 866 | * |
||
| 867 | * @param string|null $default The default value to return, if the store view code has not been set |
||
| 868 | * |
||
| 869 | * @return string The store view code |
||
| 870 | */ |
||
| 871 | 8 | public function getStoreViewCode($default = null) |
|
| 888 | |||
| 889 | /** |
||
| 890 | * Prepare's the store view code in the subject. If the store_view_code row doesn't contain |
||
| 891 | * any value, the default code of the default store view will be set. |
||
| 892 | * |
||
| 893 | * @return void |
||
| 894 | */ |
||
| 895 | 2 | public function prepareStoreViewCode() |
|
| 906 | |||
| 907 | /** |
||
| 908 | * Return's the store ID of the store with the passed store view code |
||
| 909 | * |
||
| 910 | * @param string $storeViewCode The store view code to return the store ID for |
||
| 911 | * |
||
| 912 | * @return integer The ID of the store with the passed ID |
||
| 913 | * @throws \Exception Is thrown, if the store with the actual code is not available |
||
| 914 | */ |
||
| 915 | 4 | public function getStoreId($storeViewCode) |
|
| 933 | |||
| 934 | /** |
||
| 935 | * Return's the store ID of the actual row, or of the default store |
||
| 936 | * if no store view code is set in the CSV file. |
||
| 937 | * |
||
| 938 | * @param string|null $default The default store view code to use, if no store view code is set in the CSV file |
||
| 939 | * |
||
| 940 | * @return integer The ID of the actual store |
||
| 941 | * @throws \Exception Is thrown, if the store with the actual code is not available |
||
| 942 | */ |
||
| 943 | 2 | public function getRowStoreId($default = null) |
|
| 954 | |||
| 955 | /** |
||
| 956 | * Return's the root category for the actual view store. |
||
| 957 | * |
||
| 958 | * @return array The store's root category |
||
| 959 | * @throws \Exception Is thrown if the root category for the passed store code is NOT available |
||
| 960 | */ |
||
| 961 | 2 | public function getRootCategory() |
|
| 975 | |||
| 976 | /** |
||
| 977 | * Return's the Magento configuration value. |
||
| 978 | * |
||
| 979 | * @param string $path The Magento path of the requested configuration value |
||
| 980 | * @param mixed $default The default value that has to be returned, if the requested configuration value is not set |
||
| 981 | * @param string $scope The scope the configuration value has been set |
||
| 982 | * @param integer $scopeId The scope ID the configuration value has been set |
||
| 983 | * |
||
| 984 | * @return mixed The configuration value |
||
| 985 | * @throws \Exception Is thrown, if nor a value can be found or a default value has been passed |
||
| 986 | */ |
||
| 987 | 5 | public function getCoreConfigData($path, $default = null, $scope = ScopeKeys::SCOPE_DEFAULT, $scopeId = 0) |
|
| 1063 | |||
| 1064 | /** |
||
| 1065 | * Resolve the original column name for the passed one. |
||
| 1066 | * |
||
| 1067 | * @param string $columnName The column name that has to be resolved |
||
| 1068 | * |
||
| 1069 | * @return string|null The original column name |
||
| 1070 | */ |
||
| 1071 | 2 | public function resolveOriginalColumnName($columnName) |
|
| 1093 | |||
| 1094 | /** |
||
| 1095 | * Return's the original data if available, or an empty array. |
||
| 1096 | * |
||
| 1097 | * @return array The original data |
||
| 1098 | */ |
||
| 1099 | 2 | public function getOriginalData() |
|
| 1114 | |||
| 1115 | /** |
||
| 1116 | * Query's whether or not the actual column contains original data like |
||
| 1117 | * filename, line number and column names. |
||
| 1118 | * |
||
| 1119 | * @return boolean TRUE if the actual column contains origin data, else FALSE |
||
| 1120 | */ |
||
| 1121 | 3 | public function hasOriginalData() |
|
| 1125 | |||
| 1126 | /** |
||
| 1127 | * Wraps the passed exeception into a new one by trying to resolve the original filname, |
||
| 1128 | * line number and column names and use it for a detailed exception message. |
||
| 1129 | * |
||
| 1130 | * @param array $columnNames The column names that should be resolved and wrapped |
||
| 1131 | * @param \Exception $parent The exception we want to wrap |
||
| 1132 | * @param string $className The class name of the exception type we want to wrap the parent one |
||
| 1133 | * |
||
| 1134 | * @return \Exception the wrapped exception |
||
| 1135 | */ |
||
| 1136 | 2 | public function wrapException( |
|
| 1181 | |||
| 1182 | /** |
||
| 1183 | * Strip's the exception suffix containing filename and line number from the |
||
| 1184 | * passed message. |
||
| 1185 | * |
||
| 1186 | * @param string $message The message to strip the exception suffix from |
||
| 1187 | * |
||
| 1188 | * @return mixed The message without the exception suffix |
||
| 1189 | */ |
||
| 1190 | 2 | public function stripExceptionSuffix($message) |
|
| 1194 | |||
| 1195 | /** |
||
| 1196 | * Append's the exception suffix containing filename and line number to the |
||
| 1197 | * passed message. If no message has been passed, only the suffix will be |
||
| 1198 | * returned |
||
| 1199 | * |
||
| 1200 | * @param string|null $message The message to append the exception suffix to |
||
| 1201 | * @param string|null $filename The filename used to create the suffix |
||
| 1202 | * @param string|null $lineNumber The line number used to create the suffx |
||
| 1203 | * |
||
| 1204 | * @return string The message with the appended exception suffix |
||
| 1205 | */ |
||
| 1206 | 12 | public function appendExceptionSuffix($message = null, $filename = null, $lineNumber = null) |
|
| 1227 | |||
| 1228 | /** |
||
| 1229 | * Raises the value for the counter with the passed key by one. |
||
| 1230 | * |
||
| 1231 | * @param mixed $counterName The name of the counter to raise |
||
| 1232 | * |
||
| 1233 | * @return integer The counter's new value |
||
| 1234 | */ |
||
| 1235 | 1 | public function raiseCounter($counterName) |
|
| 1244 | |||
| 1245 | /** |
||
| 1246 | * Merge the passed array into the status of the actual import. |
||
| 1247 | * |
||
| 1248 | * @param array $status The status information to be merged |
||
| 1249 | * |
||
| 1250 | * @return void |
||
| 1251 | */ |
||
| 1252 | 1 | public function mergeAttributesRecursive(array $status) |
|
| 1261 | } |
||
| 1262 |
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..