| Total Complexity | 6 |
| Total Lines | 70 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | trait EventHandlers |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * Empty event handler |
||
| 9 | * |
||
| 10 | * Get called when the entity get initialized. |
||
| 11 | * |
||
| 12 | * @param bool $new Whether or not the entity is new or from database |
||
| 13 | * @codeCoverageIgnore dummy event handler |
||
| 14 | */ |
||
| 15 | public function onInit($new) |
||
|
|
|||
| 16 | { |
||
| 17 | } |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Empty event handler |
||
| 21 | * |
||
| 22 | * Get called when something is changed with magic setter. |
||
| 23 | * |
||
| 24 | * @param string $attribute The variable that got changed.merge(node.inheritedProperties) |
||
| 25 | * @param mixed $oldValue The old value of the variable |
||
| 26 | * @param mixed $value The new value of the variable |
||
| 27 | * @codeCoverageIgnore dummy event handler |
||
| 28 | */ |
||
| 29 | public function onChange($attribute, $oldValue, $value) |
||
| 30 | { |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Empty event handler |
||
| 35 | * |
||
| 36 | * Get called before the entity get inserted in database. |
||
| 37 | * |
||
| 38 | * @codeCoverageIgnore dummy event handler |
||
| 39 | */ |
||
| 40 | public function prePersist() |
||
| 41 | { |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Empty event handler |
||
| 46 | * |
||
| 47 | * Get called before the entity get updated in database. |
||
| 48 | * |
||
| 49 | * @codeCoverageIgnore dummy event handler |
||
| 50 | */ |
||
| 51 | public function preUpdate() |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Empty event handler |
||
| 57 | * |
||
| 58 | * Get called after the entity got inserted in database. |
||
| 59 | * |
||
| 60 | * @codeCoverageIgnore dummy event handler |
||
| 61 | */ |
||
| 62 | public function postPersist() |
||
| 63 | { |
||
| 64 | } |
||
| 65 | |||
| 66 | /** |
||
| 67 | * Empty event handler |
||
| 68 | * |
||
| 69 | * Get called after the entity got updated in database. |
||
| 70 | * |
||
| 71 | * @codeCoverageIgnore dummy event handler |
||
| 72 | */ |
||
| 73 | public function postUpdate() |
||
| 75 | } |
||
| 76 | } |
||
| 77 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.