Total Complexity | 4 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
17 | trait DateTimeBase |
||
18 | { |
||
19 | /** |
||
20 | * @param DateTimeZone $timezone |
||
21 | * |
||
22 | * @return self |
||
23 | */ |
||
24 | 4 | public function setTimezone($timezone) |
|
29 | } |
||
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 |
|
51 | } |
||
52 | |||
53 | /** |
||
54 | * Get a PHP-DateTime-Object from this class for further handling |
||
55 | * |
||
56 | * @return self |
||
57 | */ |
||
58 | 1 | public function getDateTime() |
|
63 |
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. Please note the @ignore annotation hint above.