Passed
Pull Request — master (#65)
by Sergey
03:06
created

FlysystemDependencyProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 24
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getFilesystemBuilderPluginCollection() 0 5 1
A addFilesystemBuilderPluginCollection() 0 7 1
1
<?php
2
3
/**
4
 * This file is part of the Spryker Commerce OS.
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace Pyz\Service\Flysystem;
9
10
use Spryker\Service\Flysystem\FlysystemDependencyProvider as SprykerFlysystemDependencyProvider;
11
use Spryker\Service\FlysystemFtpFileSystem\Plugin\Flysystem\FtpFilesystemBuilderPlugin;
12
use Spryker\Service\FlysystemLocalFileSystem\Plugin\Flysystem\LocalFilesystemBuilderPlugin;
13
use Spryker\Service\Kernel\Container;
14
15
class FlysystemDependencyProvider extends SprykerFlysystemDependencyProvider
16
{
17
    /**
18
     * @param \Spryker\Service\Kernel\Container $container
19
     *
20
     * @return \Spryker\Service\Kernel\Container
21
     */
22
    protected function addFilesystemBuilderPluginCollection($container): Container
23
    {
24
        $container->set(static::PLUGIN_COLLECTION_FILESYSTEM_BUILDER, function (Container $container) {
0 ignored issues
show
Unused Code introduced by
The parameter $container is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

24
        $container->set(static::PLUGIN_COLLECTION_FILESYSTEM_BUILDER, function (/** @scrutinizer ignore-unused */ Container $container) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
25
            return $this->getFilesystemBuilderPluginCollection();
26
        });
27
28
        return $container;
29
    }
30
31
    /**
32
     * @return array<\Spryker\Service\Flysystem\Dependency\Plugin\FlysystemFilesystemBuilderPluginInterface>
33
     */
34
    protected function getFilesystemBuilderPluginCollection(): array
35
    {
36
        return [
37
            new FtpFilesystemBuilderPlugin(),
38
            new LocalFilesystemBuilderPlugin(),
39
        ];
40
    }
41
}
42