@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | /** |
82 | 82 | * Format the date value as a string based on the current locale |
83 | 83 | * |
84 | - * @param DateTime|int|string $date |
|
84 | + * @param \DateTime $date |
|
85 | 85 | * @param string $format null, 'short', 'medium', 'long', 'full' or pattern |
86 | 86 | * @param string $calendar 'gregorian' or 'traditional' |
87 | 87 | * @return string |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | /** |
105 | 105 | * Format the time value as a string based on the current locale |
106 | 106 | * |
107 | - * @param DateTime|int|string $date |
|
107 | + * @param \DateTime $date |
|
108 | 108 | * @param string $format 'short', 'medium', 'long', 'full' or pattern |
109 | 109 | * @param string $calendar 'gregorian' or 'traditional' |
110 | 110 | * @return string |
@@ -161,6 +161,7 @@ discard block |
||
161 | 161 | * Split duration into seconds, minutes, hours, days, weeks and years. |
162 | 162 | * |
163 | 163 | * @param int $seconds |
164 | + * @param integer $max |
|
164 | 165 | * @return array |
165 | 166 | */ |
166 | 167 | protected function splitDuration($seconds, $max) |
@@ -196,7 +197,7 @@ discard block |
||
196 | 197 | * |
197 | 198 | * @param int $seconds Time in seconds |
198 | 199 | * @param array $units Time units (seconds, minutes, hours, days, weeks, years) |
199 | - * @param string $separator |
|
200 | + * @param string $seperator |
|
200 | 201 | * @return string |
201 | 202 | */ |
202 | 203 | public function duration($seconds, $units=array('s', 'm', 'h', 'd', 'w', 'y'), $seperator=' ') |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | if (!isset($date)) return null; |
92 | 92 | |
93 | 93 | if ($date instanceof \DateTime); |
94 | - elseif (is_int($date)) $date = \DateTime::createFromFormat('U', $date); |
|
95 | - else $date = new \DateTime((string)$date); |
|
94 | + elseif (is_int($date)) $date = \DateTime::createFromFormat('U', $date); |
|
95 | + else $date = new \DateTime((string)$date); |
|
96 | 96 | |
97 | 97 | $calendar = $calendar == 'traditional' ? \IntlDateFormatter::TRADITIONAL : \IntlDateFormatter::GREGORIAN; |
98 | 98 | list($format, $pattern) = $this->getFormat($format, $calendar); |
@@ -114,8 +114,8 @@ discard block |
||
114 | 114 | if (!isset($date)) return null; |
115 | 115 | |
116 | 116 | if ($date instanceof \DateTime); |
117 | - elseif (is_int($date)) $date = \DateTime::createFromFormat('U', $date); |
|
118 | - else $date = new \DateTime((string)$date); |
|
117 | + elseif (is_int($date)) $date = \DateTime::createFromFormat('U', $date); |
|
118 | + else $date = new \DateTime((string)$date); |
|
119 | 119 | |
120 | 120 | $calendar = $calendar == 'traditional' ? \IntlDateFormatter::TRADITIONAL : \IntlDateFormatter::GREGORIAN; |
121 | 121 | list($format, $pattern) = $this->getFormat($format, $calendar); |
@@ -137,8 +137,8 @@ discard block |
||
137 | 137 | if (!isset($date)) return null; |
138 | 138 | |
139 | 139 | if ($date instanceof \DateTime); |
140 | - elseif (is_int($date)) $date = \DateTime::createFromFormat('U', $date); |
|
141 | - else $date = new \DateTime((string)$date); |
|
140 | + elseif (is_int($date)) $date = \DateTime::createFromFormat('U', $date); |
|
141 | + else $date = new \DateTime((string)$date); |
|
142 | 142 | |
143 | 143 | $calendar = $calendar == 'traditional' ? \IntlDateFormatter::TRADITIONAL : \IntlDateFormatter::GREGORIAN; |
144 | 144 |
@@ -65,7 +65,7 @@ |
||
65 | 65 | * |
66 | 66 | * @param string $value |
67 | 67 | * @param string $pattern |
68 | - * @return boolean |
|
68 | + * @return null|integer |
|
69 | 69 | */ |
70 | 70 | public function match($value, $pattern) |
71 | 71 | { |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function sum($array) |
45 | 45 | { |
46 | - if (!isset($array)) return null; |
|
47 | - return array_sum((array)$array); |
|
46 | + if (!isset($array)) return null; |
|
47 | + return array_sum((array)$array); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function product($array) |
57 | 57 | { |
58 | - if (!isset($array)) return null; |
|
59 | - return array_product((array)$array); |
|
58 | + if (!isset($array)) return null; |
|
59 | + return array_product((array)$array); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function values($array) |
69 | 69 | { |
70 | - if (!isset($array)) return null; |
|
71 | - return array_values((array)$array); |
|
70 | + if (!isset($array)) return null; |
|
71 | + return array_values((array)$array); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 |