LocalAdapterFactory::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 2
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