LocalAdapterFactory::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 9
ccs 0
cts 6
cp 0
rs 9.6666
cc 1
eloc 5
nc 1
nop 0
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