Completed
Push — master ( a0e8ce...60fa13 )
by Bas
12s
created

VfsAdapterFactory::validateConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 1
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 1
        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 1
    protected function validateConfig()
34
    {
35 1
    }
36
}
37