webshelf /
framework
We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| 1 | <?php |
||
| 2 | |||
| 3 | namespace App\Model; |
||
| 4 | |||
| 5 | use App\Classes\Interfaces\Linker; |
||
| 6 | use App\Classes\Interfaces\Linkable; |
||
| 7 | use Illuminate\Database\Eloquent\Model; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * Class Activity. |
||
| 11 | * |
||
| 12 | * @property string $message |
||
| 13 | * @property int $event |
||
| 14 | * |
||
| 15 | * @property Linkable $model |
||
| 16 | * @property Account $account |
||
| 17 | */ |
||
| 18 | class Activity extends Model |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * @var int |
||
| 22 | */ |
||
| 23 | public static $deleted = 0; |
||
| 24 | /** |
||
| 25 | * @var int |
||
| 26 | */ |
||
| 27 | public static $created = 1; |
||
| 28 | /** |
||
| 29 | * @var int |
||
| 30 | */ |
||
| 31 | public static $updated = 2; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * The table associated with the model. |
||
| 35 | * |
||
| 36 | * @var string |
||
| 37 | */ |
||
| 38 | protected $table = 'activity'; |
||
| 39 | |||
| 40 | /** |
||
| 41 | * The attributes that are not mass assignable. |
||
| 42 | * |
||
| 43 | * @var array |
||
| 44 | */ |
||
| 45 | protected $guarded = []; |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @return bool|string |
||
| 49 | */ |
||
| 50 | public function eventName() |
||
| 51 | { |
||
| 52 | switch ($this->event) { |
||
| 53 | case self::$deleted: return 'deleted'; |
||
| 54 | case self::$created: return 'created'; |
||
| 55 | case self::$updated: return 'updated'; |
||
| 56 | } |
||
| 57 | |||
| 58 | return false; |
||
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
| 63 | */ |
||
| 64 | public function account() |
||
| 65 | { |
||
| 66 | return $this->belongsTo(Account::class, 'account_id', 'id'); |
||
| 67 | } |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @return Linker |
||
| 71 | */ |
||
| 72 | public function model() |
||
| 73 | { |
||
| 74 | return $this->morphTo()->withTrashed(); |
||
| 75 | } |
||
| 76 | |||
| 77 | /** |
||
| 78 | * @param int $action |
||
| 79 | * @param Model $model |
||
| 80 | * @param Account|null $account |
||
| 81 | * @return mixed |
||
| 82 | */ |
||
| 83 | public function log(int $action, Model $model, Account $account = null) |
||
| 84 | { |
||
| 85 | $this->setAttribute('event', $action); |
||
| 86 | |||
| 87 | $this->setAttribute('model_id', $model->getKey()); |
||
| 88 | |||
| 89 | $this->setAttribute('model_type', $model->getMorphClass()); |
||
| 90 | |||
| 91 | $this->setAttribute('account_id', $account->getKey()); |
||
|
0 ignored issues
–
show
|
|||
| 92 | |||
| 93 | return $this->save(); |
||
| 94 | } |
||
| 95 | } |
||
| 96 |
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.