Test Failed
Push — master ( cf0477...35c5f0 )
by BruceScrutinizer
02:00
created

CollectedFactory   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A createMutableCollection() 0 3 1
A createEmptyMutableCollection() 0 3 1
A createEmptyReadOnlyCollection() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace NamespaceProtector\Result\Factory;
6
7
use NamespaceProtector\Result\ResultCollected;
8
use NamespaceProtector\Result\ResultCollectedReadable;
9
10
final class CollectedFactory implements CollectionFactoryInterface
11
{
12
    public function createMutableCollection(array $list): ResultCollected
13
    {
14
        return new ResultCollected($list);
15
    }
16
17
    public function createEmptyMutableCollection(): ResultCollected
18
    {
19
        return new ResultCollected();
20
    }
21
22
    public function createEmptyReadOnlyCollection(): ResultCollectedReadable
23
    {
24
        return new ResultCollectedReadable($this->createEmptyMutableCollection());
25
    }
26
}
27