Completed
Push — master ( dc1cd9...e893e0 )
by Guido
02:44
created

Component   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 35
ccs 8
cts 8
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A resolveCustom() 0 4 1
A flysystem() 0 4 1
1
<?php
2
3
namespace Mosaic\Filesystem;
4
5
use Mosaic\Common\Components\AbstractComponent;
6
use Mosaic\Common\Conventions\FolderStructureConvention;
7
use Mosaic\Filesystem\Adapters\Flysystem\Component as FlysystemComponent;
8
9
class Component extends AbstractComponent
10
{
11
    /**
12
     * @var FolderStructureConvention
13
     */
14
    private $folderStructure;
15
16
    /**
17
     * @param string                    $implementation
18
     * @param FolderStructureConvention $folderStructure
19
     */
20 1
    protected function __construct(string $implementation, FolderStructureConvention $folderStructure)
21
    {
22 1
        parent::__construct($implementation);
23 1
        $this->folderStructure = $folderStructure;
24 1
    }
25
26
    /**
27
     * @param  FolderStructureConvention $folderStructure
28
     * @return FlysystemComponent
29
     */
30 1
    public static function flysystem(FolderStructureConvention $folderStructure)
31
    {
32 1
        return new FlysystemComponent($folderStructure);
33
    }
34
35
    /**
36
     * @param  callable $callback
37
     * @return array
38
     */
39 1
    public function resolveCustom(callable $callback) : array
40
    {
41 1
        return $callback($this->folderStructure);
42
    }
43
}
44