| Total Complexity | 6 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Coverage | 90.91% |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class ProjectRegistry implements RegistryInterface |
||
| 6 | { |
||
| 7 | protected $projects = [ |
||
| 8 | 'working' => [], |
||
| 9 | 'submitted' => [], |
||
| 10 | 'preparing' => [] |
||
| 11 | ]; |
||
| 12 | |||
| 13 | 1 | public function store(array $items = []) |
|
| 14 | { |
||
| 15 | 1 | foreach ($items as $project) { |
|
| 16 | 1 | $poll = $project->getApprovalPoll(); |
|
| 17 | 1 | if ($poll !== null && $poll->getIsEnded() === true) { |
|
| 18 | 1 | $this->projects['working'][] = $project; |
|
| 19 | 1 | } elseif ($poll !== null) { |
|
| 20 | $this->projects['submitted'][] = $project; |
||
| 21 | } else { |
||
| 22 | 1 | $this->projects['preparing'][] = $project; |
|
| 23 | } |
||
| 24 | } |
||
| 25 | 1 | } |
|
| 26 | |||
| 27 | 1 | public function getItems(): array |
|
| 30 | } |
||
| 31 | } |