| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | protected static function bootRecordsActivity() |
||
| 15 | { |
||
| 16 | // Comprovar si no hi ha usuari logat. |
||
| 17 | if (auth()->guest()) { |
||
|
|
|||
| 18 | return; |
||
| 19 | } |
||
| 20 | |||
| 21 | foreach (static::getActivitiesToRecord() as $event) { |
||
| 22 | static::$event(function ($model) use ($event) { |
||
| 23 | $model->recordActivity($event); |
||
| 24 | }); |
||
| 25 | } |
||
| 26 | } |
||
| 27 | |||
| 74 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: