Completed
Push — master ( 9b2eb4...595a6b )
by Bas
05:39
created

VfsAdapterFactory::validateConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 1 Features 1
Metric Value
c 2
b 1
f 1
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
cc 1
eloc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace BsbFlysystem\Adapter\Factory;
4
5
use BsbFlysystem\Exception\RequirementsException;
6
use League\Flysystem\Vfs\VfsAdapter as Adapter;
7
use VirtualFileSystem\FileSystem as Vfs;
8
use Zend\ServiceManager\FactoryInterface;
9
use Zend\ServiceManager\ServiceLocatorInterface;
10
11
class VfsAdapterFactory extends AbstractAdapterFactory
12
{
13
    /**
14
     * @inheritdoc
15
     */
16 1
    public function doCreateService(ServiceLocatorInterface $serviceLocator)
17
    {
18
        if (!class_exists(\League\Flysystem\Vfs\VfsAdapter::class)) {
19
            throw new RequirementsException(
20
                ['league/flysystem-vfs'],
21
                'Vfs'
22
            );
23
        }
24
25 1
        return new Adapter(new Vfs());
26
    }
27
28
    /**
29
     * @inheritdoc
30
     *
31
     * This adapter has no options
32
     */
33
    protected function validateConfig()
34
    {
35
36
    }
37
}
38