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

GlideHelper::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 2
dl 0
loc 10
rs 10
c 0
b 0
f 0
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