| Conditions | 2 |
| Paths | 1 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php namespace Mpociot\Teamwork\Traits; |
||
| 24 | protected static function boot() |
||
| 25 | { |
||
| 26 | parent::boot(); |
||
| 27 | |||
| 28 | static::addGlobalScope('team', function (Builder $builder) { |
||
| 29 | static::teamGuard(); |
||
| 30 | |||
| 31 | $builder->where('team_id', auth()->user()->currentTeam->getKey()); |
||
|
|
|||
| 32 | }); |
||
| 33 | |||
| 34 | static::saving(function (Model $model) { |
||
| 35 | static::teamGuard(); |
||
| 36 | |||
| 37 | if (!isset($model->team_id)) { |
||
| 38 | $model->team_id = auth()->user()->currentTeam->getKey(); |
||
| 39 | } |
||
| 40 | }); |
||
| 41 | } |
||
| 42 | |||
| 70 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.