Conditions | 4 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
43 | public function getValue() |
||
44 | { |
||
45 | $parts = explode(',', trim(substr($this->value, mb_stripos($this->value, self::DIRECTIVE) + mb_strlen(self::DIRECTIVE) + 1))); |
||
46 | $count = count($parts); |
||
47 | for ($i = 1; $i <= $count; $i++) { |
||
48 | foreach ($this->supportedDateFormats as $format) { |
||
49 | $dateTime = date_create_from_format($format, trim(implode(',', array_slice($parts, 0, $i)))); |
||
50 | if ($dateTime !== false) { |
||
51 | return $dateTime->format(DATE_RFC850); |
||
52 | } |
||
53 | } |
||
54 | } |
||
55 | return null; |
||
56 | } |
||
57 | |||
69 |