1 | <?php |
||
8 | class Date |
||
9 | { |
||
10 | /** |
||
11 | * @param \Carbon\Carbon $carbon |
||
12 | * @return \Wandu\DateTime\Date |
||
13 | */ |
||
14 | 1 | public static function fromCarbon(Carbon $carbon) |
|
21 | |||
22 | /** |
||
23 | * @param string $text |
||
24 | * @param \DateTimeZone|string|int $timezone |
||
25 | * @return \Wandu\DateTime\Date |
||
26 | */ |
||
27 | 1 | public static function fromText(string $text, $timezone = null) |
|
31 | |||
32 | /** |
||
33 | * @param int $year |
||
34 | * @param int $month |
||
35 | * @param int $day |
||
36 | * @return \Wandu\DateTime\Date |
||
37 | */ |
||
38 | 12 | public static function fromDates(int $year, int $month, int $day) |
|
45 | |||
46 | /** @var \DateTime */ |
||
47 | protected $datetime; |
||
48 | |||
49 | /** |
||
50 | * @param string|\DateTime $time |
||
51 | */ |
||
52 | 14 | public function __construct($time) |
|
60 | |||
61 | /** |
||
62 | * @return string |
||
63 | */ |
||
64 | 3 | public function __toString() |
|
68 | |||
69 | /** |
||
70 | * @return int |
||
71 | */ |
||
72 | 10 | public function year(): int |
|
76 | |||
77 | /** |
||
78 | * @return int |
||
79 | */ |
||
80 | 10 | public function month(): int |
|
84 | |||
85 | /** |
||
86 | * @return int |
||
87 | */ |
||
88 | 10 | public function day(): int |
|
92 | } |
||
93 |
This check compares calls to functions or methods with their respective definitions. If the call has more 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.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.