RendererServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 24
rs 10
wmc 1
lcom 0
cbo 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 16 1
1
<?php
2
3
namespace App\Providers;
4
5
use Pimple\Container;
6
use App\Common\ApiRenderer;
7
use App\Common\MailRenderer;
8
9
final class RendererServiceProvider extends BaseServiceProvider
10
{
11
    /**
12
     * Register renderer service provider.
13
     *
14
     * @param Container $container
15
     */
16
    public function register(Container $container)
17
    {
18
        $config = $container['settings'];
19
20
        $container['apiRenderer'] = function() use ($config) {
21
            $renderer = new ApiRenderer($config);
22
23
            return $renderer;
24
        };
25
26
        $container['mailRenderer'] = function() use ($config) {
27
            $renderer = new MailRenderer($config['mailTemplate']);
28
29
            return $renderer;
30
        };
31
    }
32
}
33