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 |
||
| 50 | abstract class AbstractSubject implements SubjectInterface |
||
| 51 | { |
||
| 52 | |||
| 53 | /** |
||
| 54 | * The trait that provides basic filesystem handling functionality. |
||
| 55 | * |
||
| 56 | * @var TechDivision\Import\Subjects\FilesystemTrait |
||
| 57 | */ |
||
| 58 | use FilesystemTrait; |
||
| 59 | |||
| 60 | /** |
||
| 61 | * The trait that provides basic filesystem handling functionality. |
||
| 62 | * |
||
| 63 | * @var TechDivision\Import\SystemLoggerTrait |
||
| 64 | */ |
||
| 65 | use SystemLoggerTrait; |
||
| 66 | |||
| 67 | /** |
||
| 68 | * The trait that provides header handling functionality. |
||
| 69 | * |
||
| 70 | * @var TechDivision\Import\HeaderTrait |
||
| 71 | */ |
||
| 72 | use HeaderTrait; |
||
| 73 | |||
| 74 | /** |
||
| 75 | * The trait that provides row handling functionality. |
||
| 76 | * |
||
| 77 | * @var TechDivision\Import\RowTrait |
||
| 78 | */ |
||
| 79 | use RowTrait; |
||
| 80 | |||
| 81 | /** |
||
| 82 | * The name of the file to be imported. |
||
| 83 | * |
||
| 84 | * @var string |
||
| 85 | */ |
||
| 86 | protected $filename; |
||
| 87 | |||
| 88 | /** |
||
| 89 | * The actual line number. |
||
| 90 | * |
||
| 91 | * @var integer |
||
| 92 | */ |
||
| 93 | protected $lineNumber = 0; |
||
| 94 | |||
| 95 | /** |
||
| 96 | * The actual operation name. |
||
| 97 | * |
||
| 98 | * @var string |
||
| 99 | */ |
||
| 100 | protected $operationName ; |
||
| 101 | |||
| 102 | /** |
||
| 103 | * The flag that stop's overserver execution on the actual row. |
||
| 104 | * |
||
| 105 | * @var boolean |
||
| 106 | */ |
||
| 107 | protected $skipRow = false; |
||
| 108 | |||
| 109 | /** |
||
| 110 | * The import adapter instance. |
||
| 111 | * |
||
| 112 | * @var \TechDivision\Import\Adapter\ImportAdapterInterface |
||
| 113 | */ |
||
| 114 | protected $importAdapter; |
||
| 115 | |||
| 116 | /** |
||
| 117 | * The system configuration. |
||
| 118 | * |
||
| 119 | * @var \TechDivision\Import\Configuration\SubjectConfigurationInterface |
||
| 120 | */ |
||
| 121 | protected $configuration; |
||
| 122 | |||
| 123 | /** |
||
| 124 | * The RegistryProcessor instance to handle running threads. |
||
| 125 | * |
||
| 126 | * @var \TechDivision\Import\Services\RegistryProcessorInterface |
||
| 127 | */ |
||
| 128 | protected $registryProcessor; |
||
| 129 | |||
| 130 | /** |
||
| 131 | * The actions unique serial. |
||
| 132 | * |
||
| 133 | * @var string |
||
| 134 | */ |
||
| 135 | protected $serial; |
||
| 136 | |||
| 137 | /** |
||
| 138 | * Array with the subject's observers. |
||
| 139 | * |
||
| 140 | * @var array |
||
| 141 | */ |
||
| 142 | protected $observers = array(); |
||
| 143 | |||
| 144 | /** |
||
| 145 | * Array with the subject's callbacks. |
||
| 146 | * |
||
| 147 | * @var array |
||
| 148 | */ |
||
| 149 | protected $callbacks = array(); |
||
| 150 | |||
| 151 | /** |
||
| 152 | * The subject's callback mappings. |
||
| 153 | * |
||
| 154 | * @var array |
||
| 155 | */ |
||
| 156 | protected $callbackMappings = array(); |
||
| 157 | |||
| 158 | /** |
||
| 159 | * The available root categories. |
||
| 160 | * |
||
| 161 | * @var array |
||
| 162 | */ |
||
| 163 | protected $rootCategories = array(); |
||
| 164 | |||
| 165 | /** |
||
| 166 | * The Magento configuration. |
||
| 167 | * |
||
| 168 | * @var array |
||
| 169 | */ |
||
| 170 | protected $coreConfigData = array(); |
||
| 171 | |||
| 172 | /** |
||
| 173 | * The available stores. |
||
| 174 | * |
||
| 175 | * @var array |
||
| 176 | */ |
||
| 177 | protected $stores = array(); |
||
| 178 | |||
| 179 | /** |
||
| 180 | * The available websites. |
||
| 181 | * |
||
| 182 | * @var array |
||
| 183 | */ |
||
| 184 | protected $storeWebsites = array(); |
||
| 185 | |||
| 186 | /** |
||
| 187 | * The default store. |
||
| 188 | * |
||
| 189 | * @var array |
||
| 190 | */ |
||
| 191 | protected $defaultStore; |
||
| 192 | |||
| 193 | /** |
||
| 194 | * The store view code the create the product/attributes for. |
||
| 195 | * |
||
| 196 | * @var string |
||
| 197 | */ |
||
| 198 | protected $storeViewCode; |
||
| 199 | |||
| 200 | /** |
||
| 201 | * The UID generator for the core config data. |
||
| 202 | * |
||
| 203 | * @var \TechDivision\Import\Utils\Generators\GeneratorInterface |
||
| 204 | */ |
||
| 205 | protected $coreConfigDataUidGenerator; |
||
| 206 | |||
| 207 | /** |
||
| 208 | * UNIX timestamp with the date the last row counter has been logged. |
||
| 209 | * |
||
| 210 | * @var integer |
||
| 211 | */ |
||
| 212 | protected $lastLog = 0; |
||
| 213 | |||
| 214 | /** |
||
| 215 | * The number of the last line that has been logged with the row counter |
||
| 216 | * @var integer |
||
| 217 | */ |
||
| 218 | protected $lastLineNumber = 0; |
||
| 219 | |||
| 220 | /** |
||
| 221 | * The event emitter instance. |
||
| 222 | * |
||
| 223 | * @var \League\Event\EmitterInterface |
||
| 224 | */ |
||
| 225 | protected $emitter; |
||
| 226 | |||
| 227 | /** |
||
| 228 | * Initialize the subject instance. |
||
| 229 | * |
||
| 230 | * @param \TechDivision\Import\Services\RegistryProcessorInterface $registryProcessor The registry processor instance |
||
| 231 | * @param \TechDivision\Import\Utils\Generators\GeneratorInterface $coreConfigDataUidGenerator The UID generator for the core config data |
||
| 232 | * @param \Doctrine\Common\Collections\Collection $systemLoggers The array with the system loggers instances |
||
| 233 | * @param \League\Event\EmitterInterface $emitter The event emitter instance |
||
| 234 | */ |
||
| 235 | 77 | public function __construct( |
|
| 246 | |||
| 247 | /** |
||
| 248 | * Return's the event emitter instance. |
||
| 249 | * |
||
| 250 | * @return \League\Event\EmitterInterface The event emitter instance |
||
| 251 | */ |
||
| 252 | 11 | public function getEmitter() |
|
| 256 | |||
| 257 | /** |
||
| 258 | * Set's the name of the file to import |
||
| 259 | * |
||
| 260 | * @param string $filename The filename |
||
| 261 | * |
||
| 262 | * @return void |
||
| 263 | */ |
||
| 264 | 14 | public function setFilename($filename) |
|
| 268 | |||
| 269 | /** |
||
| 270 | * Return's the name of the file to import. |
||
| 271 | * |
||
| 272 | * @return string The filename |
||
| 273 | */ |
||
| 274 | 13 | public function getFilename() |
|
| 278 | |||
| 279 | /** |
||
| 280 | * Set's the actual operation name. |
||
| 281 | * |
||
| 282 | * @param string $operationName The actual operation name |
||
| 283 | * |
||
| 284 | * @return void |
||
| 285 | */ |
||
| 286 | 1 | public function setOperationName($operationName) |
|
| 290 | |||
| 291 | /** |
||
| 292 | * Return's the actual operation name. |
||
| 293 | * |
||
| 294 | * @return string |
||
| 295 | */ |
||
| 296 | 1 | public function getOperationName() |
|
| 300 | |||
| 301 | /** |
||
| 302 | * Set's the actual line number. |
||
| 303 | * |
||
| 304 | * @param integer $lineNumber The line number |
||
| 305 | * |
||
| 306 | * @return void |
||
| 307 | */ |
||
| 308 | 1 | public function setLineNumber($lineNumber) |
|
| 312 | |||
| 313 | /** |
||
| 314 | * Return's the actual line number. |
||
| 315 | * |
||
| 316 | * @return integer The line number |
||
| 317 | */ |
||
| 318 | 13 | public function getLineNumber() |
|
| 322 | |||
| 323 | /** |
||
| 324 | * Stop's observer execution on the actual row. |
||
| 325 | * |
||
| 326 | * @return void |
||
| 327 | */ |
||
| 328 | 1 | public function skipRow() |
|
| 332 | |||
| 333 | /** |
||
| 334 | * Return's the default callback mappings. |
||
| 335 | * |
||
| 336 | * @return array The default callback mappings |
||
| 337 | */ |
||
| 338 | 1 | public function getDefaultCallbackMappings() |
|
| 342 | |||
| 343 | /** |
||
| 344 | * Tries to format the passed value to a valid date with format 'Y-m-d H:i:s'. |
||
| 345 | * If the passed value is NOT a valid date, NULL will be returned. |
||
| 346 | * |
||
| 347 | * @param string $value The value to format |
||
| 348 | * |
||
| 349 | * @return string|null The formatted date or NULL if the date is not valid |
||
| 350 | */ |
||
| 351 | 2 | public function formatDate($value) |
|
| 362 | |||
| 363 | /** |
||
| 364 | * Extracts the elements of the passed value by exploding them |
||
| 365 | * with the also passed delimiter. |
||
| 366 | * |
||
| 367 | * @param string $value The value to extract |
||
| 368 | * @param string|null $delimiter The delimiter used to extrace the elements |
||
| 369 | * |
||
| 370 | * @return array The exploded values |
||
| 371 | */ |
||
| 372 | 2 | public function explode($value, $delimiter = null) |
|
| 385 | |||
| 386 | /** |
||
| 387 | * Queries whether or not debug mode is enabled or not, default is TRUE. |
||
| 388 | * |
||
| 389 | * @return boolean TRUE if debug mode is enabled, else FALSE |
||
| 390 | */ |
||
| 391 | 1 | public function isDebugMode() |
|
| 395 | |||
| 396 | /** |
||
| 397 | * Set's the subject configuration. |
||
| 398 | * |
||
| 399 | * @param \TechDivision\Import\Configuration\SubjectConfigurationInterface $configuration The subject configuration |
||
| 400 | * |
||
| 401 | * @return void |
||
| 402 | */ |
||
| 403 | 77 | public function setConfiguration(SubjectConfigurationInterface $configuration) |
|
| 407 | |||
| 408 | /** |
||
| 409 | * Return's the subject configuration. |
||
| 410 | * |
||
| 411 | * @return \TechDivision\Import\Configuration\SubjectConfigurationInterface The subject configuration |
||
| 412 | */ |
||
| 413 | 77 | public function getConfiguration() |
|
| 417 | |||
| 418 | /** |
||
| 419 | * Set's the import adapter instance. |
||
| 420 | * |
||
| 421 | * @param \TechDivision\Import\Adapter\ImportAdapterInterface $importAdapter The import adapter instance |
||
| 422 | * |
||
| 423 | * @return void |
||
| 424 | */ |
||
| 425 | 3 | public function setImportAdapter(ImportAdapterInterface $importAdapter) |
|
| 429 | |||
| 430 | /** |
||
| 431 | * Return's the import adapter instance. |
||
| 432 | * |
||
| 433 | * @return \TechDivision\Import\Adapter\ImportAdapterInterface The import adapter instance |
||
| 434 | */ |
||
| 435 | 3 | public function getImportAdapter() |
|
| 439 | |||
| 440 | /** |
||
| 441 | * Return's the RegistryProcessor instance to handle the running threads. |
||
| 442 | * |
||
| 443 | * @return \TechDivision\Import\Services\RegistryProcessorInterface The registry processor instance |
||
| 444 | */ |
||
| 445 | 77 | public function getRegistryProcessor() |
|
| 449 | |||
| 450 | /** |
||
| 451 | * Set's the unique serial for this import process. |
||
| 452 | * |
||
| 453 | * @param string $serial The unique serial |
||
| 454 | * |
||
| 455 | * @return void |
||
| 456 | */ |
||
| 457 | 10 | public function setSerial($serial) |
|
| 461 | |||
| 462 | /** |
||
| 463 | * Return's the unique serial for this import process. |
||
| 464 | * |
||
| 465 | * @return string The unique serial |
||
| 466 | */ |
||
| 467 | 4 | public function getSerial() |
|
| 471 | |||
| 472 | /** |
||
| 473 | * Return's the source date format to use. |
||
| 474 | * |
||
| 475 | * @return string The source date format |
||
| 476 | */ |
||
| 477 | 4 | public function getSourceDateFormat() |
|
| 481 | |||
| 482 | /** |
||
| 483 | * Return's the multiple field delimiter character to use, default value is comma (,). |
||
| 484 | * |
||
| 485 | * @return string The multiple field delimiter character |
||
| 486 | */ |
||
| 487 | 1 | public function getMultipleFieldDelimiter() |
|
| 491 | |||
| 492 | /** |
||
| 493 | * Return's the multiple value delimiter character to use, default value is comma (|). |
||
| 494 | * |
||
| 495 | * @return string The multiple value delimiter character |
||
| 496 | */ |
||
| 497 | 1 | public function getMultipleValueDelimiter() |
|
| 501 | |||
| 502 | /** |
||
| 503 | * Intializes the previously loaded global data for exactly one bunch. |
||
| 504 | * |
||
| 505 | * @param string $serial The serial of the actual import |
||
| 506 | * |
||
| 507 | * @return void |
||
| 508 | */ |
||
| 509 | 77 | public function setUp($serial) |
|
| 547 | |||
| 548 | /** |
||
| 549 | * Clean up the global data after importing the variants. |
||
| 550 | * |
||
| 551 | * @param string $serial The serial of the actual import |
||
| 552 | * |
||
| 553 | * @return void |
||
| 554 | */ |
||
| 555 | 1 | public function tearDown($serial) |
|
| 575 | |||
| 576 | /** |
||
| 577 | * Return's the target directory for the artefact export. |
||
| 578 | * |
||
| 579 | * @return string The target directory for the artefact export |
||
| 580 | */ |
||
| 581 | 1 | public function getTargetDir() |
|
| 585 | |||
| 586 | /** |
||
| 587 | * Return's the next source directory, which will be the target directory |
||
| 588 | * of this subject, in most cases. |
||
| 589 | * |
||
| 590 | * @param string $serial The serial of the actual import |
||
| 591 | * |
||
| 592 | * @return string The new source directory |
||
| 593 | */ |
||
| 594 | 4 | public function getNewSourceDir($serial) |
|
| 598 | |||
| 599 | /** |
||
| 600 | * Register the passed observer with the specific type. |
||
| 601 | * |
||
| 602 | * @param \TechDivision\Import\Observers\ObserverInterface $observer The observer to register |
||
| 603 | * @param string $type The type to register the observer with |
||
| 604 | * |
||
| 605 | * @return void |
||
| 606 | */ |
||
| 607 | 6 | public function registerObserver(ObserverInterface $observer, $type) |
|
| 619 | |||
| 620 | /** |
||
| 621 | * Register the passed callback with the specific type. |
||
| 622 | * |
||
| 623 | * @param \TechDivision\Import\Callbacks\CallbackInterface $callback The subject to register the callbacks for |
||
| 624 | * @param string $type The type to register the callback with |
||
| 625 | * |
||
| 626 | * @return void |
||
| 627 | */ |
||
| 628 | 2 | public function registerCallback(CallbackInterface $callback, $type) |
|
| 640 | |||
| 641 | /** |
||
| 642 | * Return's the array with callbacks for the passed type. |
||
| 643 | * |
||
| 644 | * @param string $type The type of the callbacks to return |
||
| 645 | * |
||
| 646 | * @return array The callbacks |
||
| 647 | */ |
||
| 648 | 1 | public function getCallbacksByType($type) |
|
| 662 | |||
| 663 | /** |
||
| 664 | * Return's the array with the available observers. |
||
| 665 | * |
||
| 666 | * @return array The observers |
||
| 667 | */ |
||
| 668 | 6 | public function getObservers() |
|
| 672 | |||
| 673 | /** |
||
| 674 | * Return's the array with the available callbacks. |
||
| 675 | * |
||
| 676 | * @return array The callbacks |
||
| 677 | */ |
||
| 678 | 1 | public function getCallbacks() |
|
| 682 | |||
| 683 | /** |
||
| 684 | * Return's the callback mappings for this subject. |
||
| 685 | * |
||
| 686 | * @return array The array with the subject's callback mappings |
||
| 687 | */ |
||
| 688 | 2 | public function getCallbackMappings() |
|
| 692 | |||
| 693 | /** |
||
| 694 | * Imports the content of the file with the passed filename. |
||
| 695 | * |
||
| 696 | * |
||
| 697 | * @param string $serial The serial of the actual import |
||
| 698 | * @param string $filename The filename to process |
||
| 699 | * |
||
| 700 | * @return void |
||
| 701 | * @throws \Exception Is thrown, if the import can't be processed |
||
| 702 | */ |
||
| 703 | 5 | public function import($serial, $filename) |
|
| 781 | |||
| 782 | /** |
||
| 783 | * This method queries whether or not the passed filename matches |
||
| 784 | * the pattern, based on the subjects configured prefix. |
||
| 785 | * |
||
| 786 | * @param string $filename The filename to match |
||
| 787 | * |
||
| 788 | * @return boolean TRUE if the filename matches, else FALSE |
||
| 789 | */ |
||
| 790 | 5 | protected function match($filename) |
|
| 803 | |||
| 804 | /** |
||
| 805 | * Imports the passed row into the database. If the import failed, the exception |
||
| 806 | * will be catched and logged, but the import process will be continued. |
||
| 807 | * |
||
| 808 | * @param array $row The row with the data to be imported |
||
| 809 | * |
||
| 810 | * @return void |
||
| 811 | */ |
||
| 812 | 7 | public function importRow(array $row) |
|
| 891 | |||
| 892 | /** |
||
| 893 | * Queries whether or not that the subject needs an OK file to be processed. |
||
| 894 | * |
||
| 895 | * @return boolean TRUE if the subject needs an OK file, else FALSE |
||
| 896 | */ |
||
| 897 | 1 | public function isOkFileNeeded() |
|
| 901 | |||
| 902 | /** |
||
| 903 | * Return's the default store. |
||
| 904 | * |
||
| 905 | * @return array The default store |
||
| 906 | */ |
||
| 907 | public function getDefaultStore() |
||
| 911 | |||
| 912 | /** |
||
| 913 | * Return's the default store view code. |
||
| 914 | * |
||
| 915 | * @return array The default store view code |
||
| 916 | */ |
||
| 917 | 5 | public function getDefaultStoreViewCode() |
|
| 921 | |||
| 922 | /** |
||
| 923 | * Set's the store view code the create the product/attributes for. |
||
| 924 | * |
||
| 925 | * @param string $storeViewCode The store view code |
||
| 926 | * |
||
| 927 | * @return void |
||
| 928 | */ |
||
| 929 | 4 | public function setStoreViewCode($storeViewCode) |
|
| 933 | |||
| 934 | /** |
||
| 935 | * Return's the store view code the create the product/attributes for. |
||
| 936 | * |
||
| 937 | * @param string|null $default The default value to return, if the store view code has not been set |
||
| 938 | * |
||
| 939 | * @return string The store view code |
||
| 940 | */ |
||
| 941 | 8 | public function getStoreViewCode($default = null) |
|
| 958 | |||
| 959 | /** |
||
| 960 | * Prepare's the store view code in the subject. If the store_view_code row doesn't contain |
||
| 961 | * any value, the default code of the default store view will be set. |
||
| 962 | * |
||
| 963 | * @return void |
||
| 964 | */ |
||
| 965 | 2 | public function prepareStoreViewCode() |
|
| 976 | |||
| 977 | /** |
||
| 978 | * Return's the store ID of the store with the passed store view code |
||
| 979 | * |
||
| 980 | * @param string $storeViewCode The store view code to return the store ID for |
||
| 981 | * |
||
| 982 | * @return integer The ID of the store with the passed ID |
||
| 983 | * @throws \Exception Is thrown, if the store with the actual code is not available |
||
| 984 | */ |
||
| 985 | 4 | public function getStoreId($storeViewCode) |
|
| 1003 | |||
| 1004 | /** |
||
| 1005 | * Return's the store ID of the actual row, or of the default store |
||
| 1006 | * if no store view code is set in the CSV file. |
||
| 1007 | * |
||
| 1008 | * @param string|null $default The default store view code to use, if no store view code is set in the CSV file |
||
| 1009 | * |
||
| 1010 | * @return integer The ID of the actual store |
||
| 1011 | * @throws \Exception Is thrown, if the store with the actual code is not available |
||
| 1012 | */ |
||
| 1013 | 2 | public function getRowStoreId($default = null) |
|
| 1024 | |||
| 1025 | /** |
||
| 1026 | * Return's the root category for the actual view store. |
||
| 1027 | * |
||
| 1028 | * @return array The store's root category |
||
| 1029 | * @throws \Exception Is thrown if the root category for the passed store code is NOT available |
||
| 1030 | */ |
||
| 1031 | 2 | public function getRootCategory() |
|
| 1045 | |||
| 1046 | /** |
||
| 1047 | * Return's the Magento configuration value. |
||
| 1048 | * |
||
| 1049 | * @param string $path The Magento path of the requested configuration value |
||
| 1050 | * @param mixed $default The default value that has to be returned, if the requested configuration value is not set |
||
| 1051 | * @param string $scope The scope the configuration value has been set |
||
| 1052 | * @param integer $scopeId The scope ID the configuration value has been set |
||
| 1053 | * |
||
| 1054 | * @return mixed The configuration value |
||
| 1055 | * @throws \Exception Is thrown, if nor a value can be found or a default value has been passed |
||
| 1056 | */ |
||
| 1057 | 5 | public function getCoreConfigData($path, $default = null, $scope = ScopeKeys::SCOPE_DEFAULT, $scopeId = 0) |
|
| 1133 | |||
| 1134 | /** |
||
| 1135 | * Resolve the original column name for the passed one. |
||
| 1136 | * |
||
| 1137 | * @param string $columnName The column name that has to be resolved |
||
| 1138 | * |
||
| 1139 | * @return string|null The original column name |
||
| 1140 | */ |
||
| 1141 | 2 | public function resolveOriginalColumnName($columnName) |
|
| 1163 | |||
| 1164 | /** |
||
| 1165 | * Return's the original data if available, or an empty array. |
||
| 1166 | * |
||
| 1167 | * @return array The original data |
||
| 1168 | */ |
||
| 1169 | 2 | public function getOriginalData() |
|
| 1184 | |||
| 1185 | /** |
||
| 1186 | * Query's whether or not the actual column contains original data like |
||
| 1187 | * filename, line number and column names. |
||
| 1188 | * |
||
| 1189 | * @return boolean TRUE if the actual column contains origin data, else FALSE |
||
| 1190 | */ |
||
| 1191 | 3 | public function hasOriginalData() |
|
| 1195 | |||
| 1196 | /** |
||
| 1197 | * Wraps the passed exeception into a new one by trying to resolve the original filname, |
||
| 1198 | * line number and column names and use it for a detailed exception message. |
||
| 1199 | * |
||
| 1200 | * @param array $columnNames The column names that should be resolved and wrapped |
||
| 1201 | * @param \Exception $parent The exception we want to wrap |
||
| 1202 | * @param string $className The class name of the exception type we want to wrap the parent one |
||
| 1203 | * |
||
| 1204 | * @return \Exception the wrapped exception |
||
| 1205 | */ |
||
| 1206 | 2 | public function wrapException( |
|
| 1251 | |||
| 1252 | /** |
||
| 1253 | * Strip's the exception suffix containing filename and line number from the |
||
| 1254 | * passed message. |
||
| 1255 | * |
||
| 1256 | * @param string $message The message to strip the exception suffix from |
||
| 1257 | * |
||
| 1258 | * @return mixed The message without the exception suffix |
||
| 1259 | */ |
||
| 1260 | 2 | public function stripExceptionSuffix($message) |
|
| 1264 | |||
| 1265 | /** |
||
| 1266 | * Append's the exception suffix containing filename and line number to the |
||
| 1267 | * passed message. If no message has been passed, only the suffix will be |
||
| 1268 | * returned |
||
| 1269 | * |
||
| 1270 | * @param string|null $message The message to append the exception suffix to |
||
| 1271 | * @param string|null $filename The filename used to create the suffix |
||
| 1272 | * @param string|null $lineNumber The line number used to create the suffx |
||
| 1273 | * |
||
| 1274 | * @return string The message with the appended exception suffix |
||
| 1275 | */ |
||
| 1276 | 12 | public function appendExceptionSuffix($message = null, $filename = null, $lineNumber = null) |
|
| 1297 | |||
| 1298 | /** |
||
| 1299 | * Raises the value for the counter with the passed key by one. |
||
| 1300 | * |
||
| 1301 | * @param mixed $counterName The name of the counter to raise |
||
| 1302 | * |
||
| 1303 | * @return integer The counter's new value |
||
| 1304 | */ |
||
| 1305 | 1 | public function raiseCounter($counterName) |
|
| 1314 | |||
| 1315 | /** |
||
| 1316 | * Merge the passed array into the status of the actual import. |
||
| 1317 | * |
||
| 1318 | * @param array $status The status information to be merged |
||
| 1319 | * |
||
| 1320 | * @return void |
||
| 1321 | */ |
||
| 1322 | 1 | public function mergeAttributesRecursive(array $status) |
|
| 1331 | } |
||
| 1332 |
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..