1 | <?php |
||
16 | class DateTime extends AbstractFormatterProvider |
||
17 | { |
||
18 | /** |
||
19 | * Format the datetime as a date |
||
20 | * |
||
21 | * @param mixed $value |
||
22 | * @param string $format |
||
23 | * @return string |
||
24 | */ |
||
25 | 3 | public function asDate($value, $format = 'Y-m-d') |
|
29 | |||
30 | /** |
||
31 | * Format the datetime as a date |
||
32 | * |
||
33 | * @param mixed $value |
||
34 | * @param string $format |
||
35 | * @return string |
||
36 | */ |
||
37 | 1 | public function asTime($value, $format = 'H:i:s') |
|
41 | |||
42 | /** |
||
43 | * Format the datetime as a date |
||
44 | * |
||
45 | * @param mixed $value |
||
46 | * @param string $format |
||
47 | * @return string |
||
48 | */ |
||
49 | 1 | public function asDateTime($value, $format = 'Y-m-d H:i:s') |
|
53 | |||
54 | /** |
||
55 | * Take in a number of seconds and display that as a human readable amount |
||
56 | * of time |
||
57 | * |
||
58 | * From: https://jonlabelle.com/snippets/view/php/convert-seconds-to-human-readable |
||
59 | * |
||
60 | * @param int $esconds |
||
|
|||
61 | * @return string |
||
62 | * @todo allow units to be overridden (non-english..) |
||
63 | */ |
||
64 | 6 | public function asDurationHuman($seconds, $delimit = ', ') |
|
103 | |||
104 | /** |
||
105 | * Generate the output from the value |
||
106 | * |
||
107 | * @param mixed $value the datetime value |
||
108 | * @param string $format format string |
||
109 | * @return string |
||
110 | */ |
||
111 | 5 | private function output($value, $format) |
|
117 | |||
118 | /** |
||
119 | * Convert the datetime input into a instance of Carbon |
||
120 | * |
||
121 | * @param mixed $value the datetime value |
||
122 | * @return Carbon |
||
123 | */ |
||
124 | 5 | private function normaliseValue($value) |
|
133 | |||
134 | /** |
||
135 | * Get an instance of the carbon datetime handler |
||
136 | * |
||
137 | * @return Carbon |
||
138 | * @throws FormatterException if carbon isn't available |
||
139 | */ |
||
140 | 5 | private function getCarbon() |
|
149 | } |
||
150 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.