Total Complexity | 5 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
10 | class FormContentClear extends Model |
||
11 | { |
||
12 | public $count = 0; |
||
13 | |||
14 | /** @var Content|Collection */ |
||
15 | private $_records; |
||
16 | |||
17 | /** |
||
18 | * FormContentClear constructor. Pass content records collection object inside (can be empty collection) |
||
19 | * @param Content|Collection $records |
||
20 | */ |
||
21 | public function __construct($records) |
||
22 | { |
||
23 | $this->_records = $records; |
||
24 | $this->count = $this->_records->count(); |
||
25 | parent::__construct(); |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * Form display labels |
||
30 | * @return array |
||
31 | */ |
||
32 | public function labels(): array |
||
36 | ]; |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * Finally delete content item |
||
41 | */ |
||
42 | public function make() |
||
54 | } |
||
55 | } |
||
56 |
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.