| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | protected function initSoftDelete() |
||
| 15 | { |
||
| 16 | $this->softDelete = false; |
||
| 17 | |||
| 18 | $this->extendTableDefinition(TRAIT_SOFT_DELETE_FIELD_KEY, [ |
||
|
|
|||
| 19 | 'value' => &$this->softDelete, |
||
| 20 | 'validate' => null, |
||
| 21 | 'default' => 0, |
||
| 22 | 'type' => 'INT', |
||
| 23 | 'length' => 1, |
||
| 24 | 'properties' => ColumnProperty::NOT_NULL |
||
| 25 | ]); |
||
| 26 | |||
| 27 | $this->registerSearchHook(TRAIT_SOFT_DELETE_FIELD_KEY, 'softDeleteSearchHook'); |
||
| 28 | } |
||
| 29 | |||
| 56 | } |
This check looks for methods that are used by a trait but not required by it.
To illustrate, let’s look at the following code example
The trait
Idableprovides a methodequalsIdthat in turn relies on the methodgetId(). If this method does not exist on a class mixing in this trait, the method will fail.Adding the
getId()as an abstract method to the trait will make sure it is available.