FileStoragePlugin::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Apie\FileStoragePlugin;
4
5
use Apie\Core\Interfaces\ApiResourceFactoryInterface;
6
use Apie\Core\PluginInterfaces\ApieAwareInterface;
7
use Apie\Core\PluginInterfaces\ApieAwareTrait;
8
use Apie\Core\PluginInterfaces\ApiResourceFactoryProviderInterface;
9
use Apie\FileStoragePlugin\ResourceFactories\FileStorageDataLayerFactory;
10
11
class FileStoragePlugin implements ApiResourceFactoryProviderInterface, ApieAwareInterface
12
{
13
    use ApieAwareTrait;
14
15
    private $path;
16
17
    /**
18
     * @param string $path
19
     */
20
    public function __construct(string $path)
21
    {
22
        $this->path = $path;
23
    }
24
25
    public function getApiResourceFactory(): ApiResourceFactoryInterface
26
    {
27
        return new FileStorageDataLayerFactory($this->path, $this->getApie()->getIdentifierExtractor());
28
    }
29
}
30