Completed
Push — master ( 5a0a25...383c62 )
by Matteo
02:38
created

Flat   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A localDatabase() 0 9 1
1
<?php
2
3
namespace Mattbit;
4
5
use Mattbit\Flat\Database;
6
use Mattbit\Flat\Query\Parser;
7
use Mattbit\Flat\Storage\JsonEncoder;
8
use Mattbit\Flat\Storage\Engine;
9
use League\Flysystem\Filesystem;
10
use League\Flysystem\Adapter\Local;
11
12
class Flat
13
{
14
    /**
15
     * Select the database.
16
     *
17
     * @param  string $path
18
     *
19
     * @return Database
20
     */
21
    public static function localDatabase($path)
22
    {
23
        $adapter = new Local($path);
24
        $filesystem = new Filesystem($adapter);
25
        $encoder = new JsonEncoder();
26
        $engine = new Engine($filesystem, $encoder);
27
28
        return new Database($engine);
29
    }
30
}
31