Completed
Push — signal_search_issues ( 907e1e...5556b2 )
by André
26:47
created

LocalAdapterFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 9 1
1
<?php
2
/**
3
 * This file is part of the ezplatform package.
4
 *
5
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
6
 * @license For full copyright and license information view LICENSE file distributed with this source code.
7
 */
8
namespace eZ\Bundle\EzPublishIOBundle\DependencyInjection\Factory;
9
10
use League\Flysystem\Adapter\Local;
11
12
/**
13
 * Builds a Local Flysystem Adapter instance with the given permissions configuration.
14
 */
15
class LocalAdapterFactory
16
{
17
    /**
18
     * @param string $rootDir
19
     * @param int $filesPermissions Permissions used when creating files. Example: 0640.
20
     * @param int $directoriesPermissions Permissions when creating directories. Example: 0750.
21
     * @return Local
22
     */
23
    public function build($rootDir, $filesPermissions, $directoriesPermissions)
24
    {
25
        return new Local(
26
            $rootDir,
27
            LOCK_EX,
28
            Local::DISALLOW_LINKS,
29
            ['file' => ['public' => $filesPermissions], 'dir' => ['public' => $directoriesPermissions]]
30
        );
31
    }
32
}
33