| Total Complexity | 9 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 6 | class Repository implements RepositoryInterface |
||
| 7 | { |
||
| 8 | protected $model; |
||
| 9 | |||
| 10 | public function __construct(Model $model) |
||
| 11 | { |
||
| 12 | $this->model = $model; |
||
| 13 | } |
||
| 14 | |||
| 15 | public function all() |
||
| 16 | { |
||
| 17 | return $this->model->all(); |
||
| 18 | } |
||
| 19 | |||
| 20 | public function create(array $data) |
||
| 21 | { |
||
| 22 | return $this->model->create($data); |
||
| 23 | } |
||
| 24 | |||
| 25 | public function update(array $data, int $id) |
||
| 26 | { |
||
| 27 | $record = $this->find($id); |
||
|
|
|||
| 28 | return $record->update($data); |
||
| 29 | } |
||
| 30 | |||
| 31 | public function delete(int $id) |
||
| 32 | { |
||
| 33 | return $this->model->destroy($id); |
||
| 34 | } |
||
| 35 | |||
| 36 | public function show(int $id) |
||
| 37 | { |
||
| 38 | return $this->model->findOrFail($id); |
||
| 39 | } |
||
| 40 | |||
| 41 | public function getModel() |
||
| 44 | } |
||
| 45 | |||
| 46 | public function setModel($model) |
||
| 47 | { |
||
| 48 | $this->model = $model; |
||
| 49 | return $this; |
||
| 50 | } |
||
| 51 | |||
| 52 | public function with($relations) |
||
| 55 | } |
||
| 56 | } |
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.