Passed
Pull Request — master (#6396)
by Angel Fernando Quiroz
08:39
created

GlideHelper   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

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