We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Total Complexity | 5 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | class PluginRepository extends BaseRepository |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * @var Plugin|Builder|Collection |
||
| 23 | */ |
||
| 24 | protected $model; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * PageRepository constructor. |
||
| 28 | * |
||
| 29 | * @param Plugin $model |
||
| 30 | */ |
||
| 31 | public function __construct(Plugin $model) |
||
| 32 | { |
||
| 33 | $this->model = $model; |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @return mixed |
||
| 38 | */ |
||
| 39 | public function allWhereActive() : Collection |
||
| 40 | { |
||
| 41 | return $this->model->where('enabled', true)->get(); |
||
|
|
|||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @return mixed |
||
| 46 | */ |
||
| 47 | public function allWhereViewable() : Collection |
||
| 48 | { |
||
| 49 | return $this->model->where('enabled', true)->whereNull('hidden')->get(); |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @return mixed |
||
| 54 | */ |
||
| 55 | public function allWhereDisabled() : Collection |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Return the model based on the input name. |
||
| 62 | * |
||
| 63 | * @param $plugin_name |
||
| 64 | * @return Plugin|array|\stdClass |
||
| 65 | */ |
||
| 66 | public function whereName($plugin_name) |
||
| 69 | } |
||
| 70 | } |
||
| 71 |
This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.