LocalAdapterFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 2
dl 0
loc 22
ccs 0
cts 9
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __invoke() 0 9 1
1
<?php
2
namespace Staticus\FileSystem;
3
4
use League\Flysystem\Adapter\Local;
5
use Staticus\Config\ConfigInterface;
6
7
8
class LocalAdapterFactory
9
{
10
    /**
11
     * @var ConfigInterface
12
     */
13
    protected $config;
14
15
    public function __construct(ConfigInterface $config)
16
    {
17
        $this->config = $config;
18
    }
19
20
    public function __invoke()
21
    {
22
        $adapter = new Local(
23
            $this->config->get('filesystem.adapters.' . Local::class . '.options.root'),
24
            $this->config->get('filesystem.adapters.' . Local::class . '.options.writeFlags')
25
        );
26
27
        return $adapter;
28
    }
29
}
30