FilesystemPlugin   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 4
c 2
b 0
f 0
dl 0
loc 18
rs 10
ccs 4
cts 4
cp 1
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A provideDependencies() 0 3 1
A createFacade() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 *  This file is part of the Micro framework package.
7
 *
8
 *  (c) Stanislau Komar <[email protected]>
9
 *
10
 *  For the full copyright and license information, please view the LICENSE
11
 *  file that was distributed with this source code.
12
 */
13
14
namespace Micro\Plugin\Filesystem;
15
16
use Micro\Component\DependencyInjection\Container;
17
use Micro\Framework\Kernel\Plugin\ConfigurableInterface;
18
use Micro\Framework\Kernel\Plugin\DependencyProviderInterface;
19
use Micro\Framework\Kernel\Plugin\PluginConfigurationTrait;
20
use Micro\Plugin\Filesystem\Configuration\FilesystemPluginConfigurationInterface;
21
use Micro\Plugin\Filesystem\Facade\FilesystemFacade;
22
use Micro\Plugin\Filesystem\Facade\FilesystemFacadeInterface;
23
24
/**
25
 * @method FilesystemPluginConfigurationInterface configuration()
26
 */
27
class FilesystemPlugin implements DependencyProviderInterface, ConfigurableInterface
28
{
29
    use PluginConfigurationTrait;
30
31
    /**
32
     * {@inheritDoc}
33
     */
34 1
    public function provideDependencies(Container $container): void
35
    {
36 1
        $container->register(FilesystemFacadeInterface::class, fn (): FilesystemFacadeInterface => $this->createFacade());
37
    }
38
39
    /**
40
     * @return FilesystemFacadeInterface
41
     */
42 1
    protected function createFacade(): FilesystemFacadeInterface
43
    {
44 1
        return new FilesystemFacade();
45
    }
46
}
47