Solutions   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 5
c 2
b 0
f 0
dl 0
loc 17
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A current() 0 3 1
A __toString() 0 5 1
1
<?php declare(strict_types=1);
2
3
namespace Stratadox\PuzzleSolver;
4
5
use Stratadox\ImmutableCollection\ImmutableCollection;
6
use function implode;
7
use const PHP_EOL;
8
9
/**
10
 * Collection of @see Solution objects
11
 *
12
 * @author Stratadox
13
 */
14
final class Solutions extends ImmutableCollection
15
{
16
    public function __construct(Solution ...$solutions)
17
    {
18
        parent::__construct(...$solutions);
19
    }
20
21
    public function current(): Solution
22
    {
23
        return parent::current();
24
    }
25
26
    public function __toString(): string
27
    {
28
        return implode(
29
            PHP_EOL . PHP_EOL . "---" . PHP_EOL . PHP_EOL,
30
            $this->items()
31
        );
32
    }
33
}
34