| Conditions | 7 |
| Paths | 9 |
| Total Lines | 23 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 56 |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | public function getAllValidDates($year, $singleDay = true, $multiDays = true) |
||
| 17 | { |
||
| 18 | $items = $this->getAllDates($year); |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var $value SpecialDateInterface |
||
| 22 | */ |
||
| 23 | foreach ($items as $key => $value) { |
||
| 24 | if ($value->isValid() === false) { |
||
| 25 | unset($items[$key]); |
||
| 26 | } |
||
| 27 | |||
| 28 | if (!$singleDay && $value->getTotalLength() === 1) { |
||
| 29 | unset($items[$key]); |
||
| 30 | } |
||
| 31 | |||
| 32 | if (!$multiDays && $value->getTotalLength() > 1) { |
||
| 33 | unset($items[$key]); |
||
| 34 | } |
||
| 35 | } |
||
| 36 | |||
| 37 | return $items; |
||
| 38 | } |
||
| 39 | |||
| 88 |