1 | <?php |
||
17 | trait DateTimeBase |
||
18 | { |
||
19 | /** |
||
20 | * @param DateTimeZone $timezone |
||
21 | * |
||
22 | * @return self |
||
23 | */ |
||
24 | 4 | public function setTimezone($timezone) |
|
30 | |||
31 | /** |
||
32 | * Parse a string into a new DateTime object according to the specified format |
||
33 | * |
||
34 | * @param string $format Format accepted by date(). |
||
35 | * @param string $time String representing the time. |
||
36 | * @param DateTimeZone $timezone A DateTimeZone object representing the desired time zone. |
||
37 | * |
||
38 | * @link http://php.net/manual/en/datetime.createfromformat.php |
||
39 | * @return self |
||
40 | */ |
||
41 | 4 | public static function createFromFormat($format, $time, DateTimeZone $timezone = null) : self |
|
52 | } |
||
53 |
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.