| Conditions | 19 |
| Paths | 19 |
| Total Lines | 25 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 23 | public function isHistoryEventProduced(HistoryEventTypeInterface $eventType, $entity): bool |
||
| 24 | { |
||
| 25 | return HistoryEventTypes::processInstanceStart()->equals($eventType) |
||
|
|
|||
| 26 | || HistoryEventTypes::processInstanceUpdate()->equals($eventType) |
||
| 27 | || HistoryEventTypes::processInstanceMigrate()->equals($eventType) |
||
| 28 | || HistoryEventTypes::processInstanceEnd()->equals($eventType) |
||
| 29 | |||
| 30 | || HistoryEventTypes::taskInstanceCreate()->equals($eventType) |
||
| 31 | || HistoryEventTypes::taskInstanceUpdate()->equals($eventType) |
||
| 32 | || HistoryEventTypes::taskInstanceMigrate()->equals($eventType) |
||
| 33 | || HistoryEventTypes::taskInstanceComplete()->equals($eventType) |
||
| 34 | || HistoryEventTypes::taskInstanceDelete()->equals($eventType) |
||
| 35 | |||
| 36 | || HistoryEventTypes::activityInstanceStart()->equals($eventType) |
||
| 37 | || HistoryEventTypes::activityInstanceUpdate()->equals($eventType) |
||
| 38 | || HistoryEventTypes::activityInstanceMigrate()->equals($eventType) |
||
| 39 | || HistoryEventTypes::activityInstanceEnd()->equals($eventType) |
||
| 40 | |||
| 41 | || HistoryEventTypes::caseInstanceCreate()->equals($eventType) |
||
| 42 | || HistoryEventTypes::caseInstanceUpdate()->equals($eventType) |
||
| 43 | || HistoryEventTypes::caseInstanceClose()->equals($eventType) |
||
| 44 | |||
| 45 | || HistoryEventTypes::caseActivityInstanceCreate()->equals($eventType) |
||
| 46 | || HistoryEventTypes::caseActivityInstanceUpdate()->equals($eventType) |
||
| 47 | || HistoryEventTypes::caseActivityInstanceEnd()->equals($eventType); |
||
| 48 | } |
||
| 50 |