| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 45 | 1 | public function findSpecialDateByDateTime(\DateTime $date) |
|
| 46 | { |
||
| 47 | 1 | $formattedDate = $date->format('Y') . '-' . $date->format('m') . $date->format('d'); |
|
| 48 | 1 | $items = $this->getAllDates($date->format('Y')); |
|
| 49 | 1 | $found = []; |
|
| 50 | |||
| 51 | /** |
||
| 52 | * @var $item SpecialDateInterface |
||
| 53 | */ |
||
| 54 | 1 | foreach ($items as $key => $item) { |
|
| 55 | 1 | $formattedStartDate = $item->getStartDate()->format('Y') . '-' . $item->getStartDate()->format('m') . $item->getStartDate()->format('d'); |
|
| 56 | |||
| 57 | 1 | if ($formattedDate === $formattedStartDate) { |
|
| 58 | 1 | $found[$key] = $item; |
|
| 59 | } |
||
| 60 | } |
||
| 61 | |||
| 62 | 1 | return $found; |
|
| 63 | } |
||
| 64 | |||
| 88 |