Passed
Push — master ( 323135...9f183a )
by Julito
13:17
created

Glide   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 37
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getFilters() 0 3 1
A getServer() 0 3 1
A __construct() 0 10 1
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\CoreBundle\Component\Utils;
5
6
use League\Glide\Responses\SymfonyResponseFactory;
7
use League\Glide\Server;
8
use League\Glide\ServerFactory;
9
10
/**
11
 * Class Glide.
12
 */
13
class Glide
14
{
15
    protected $server;
16
    protected $filters;
17
18
    /**
19
     * Glide constructor.
20
     *
21
     * @param array $config
22
     * @param array $filters
23
     */
24
    public function __construct(array $config, array $filters)
25
    {
26
        $this->server = ServerFactory::create(
27
            [
28
                'response' => new SymfonyResponseFactory(),
29
                'source' => $config['source'],
30
                'cache' => $config['cache'],
31
            ]
32
        );
33
        $this->filters = $filters;
34
    }
35
36
    /**
37
     * @return Server
38
     */
39
    public function getServer(): Server
40
    {
41
        return $this->server;
42
    }
43
44
    /**
45
     * @return array
46
     */
47
    public function getFilters(): array
48
    {
49
        return $this->filters;
50
    }
51
}
52