Flat::localDatabase()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
3
namespace Mattbit;
4
5
use League\Flysystem\Plugin\ListPaths;
6
use Mattbit\Flat\Database;
7
use Mattbit\Flat\Storage\JsonEncoder;
8
use Mattbit\Flat\Storage\FilesystemEngine;
9
10
class Flat
11
{
12
    /**
13
     * Select the database.
14
     *
15
     * @param  string $path
16
     *
17
     * @return Database
18
     */
19
    public static function localDatabase($path)
20
    {
21
        $encoder = new JsonEncoder();
22
        $engine = new FilesystemEngine($path, $encoder);
23
24
        return new Database($engine);
25
    }
26
}
27