FilesFolders   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 25
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 14 1
A save() 0 5 1
1
<?php
2
3
namespace NFePHP\Esfinge\Files;
4
5
use League\Flysystem\Filesystem;
6
use League\Flysystem\Adapter\Local;
7
8
class FilesFolders
9
{
10
    protected static $filesystem;
11
    
12 3
    protected static function init($path)
13
    {
14 3
        $adapter = new Local($path, LOCK_EX, Local::DISALLOW_LINKS, [
15 1
            'file' => [
16 2
                'public' => 0755,
17
                'private' => 0700
18 2
            ],
19
            'dir' => [
20 2
                'public' => 0755,
21
                'private' => 0700
22 2
            ]
23 2
        ]);
24 3
        self::$filesystem = new Filesystem($adapter);
25 3
    }
26
    
27 3
    public static function save($path, $filename, $contents)
28
    {
29 3
        self::init($path);
30 3
        self::$filesystem->put($filename, $contents, ['visibility' => 'public']);
31 3
    }
32
}
33