Completed
Push — master ( 4f3de5...9b9e7a )
by Pavel
05:51
created

RendererServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 10
c 0
b 0
f 0
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\Renderer;
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['renderer'] = function (Container $c) use ($config) {
0 ignored issues
show
Unused Code introduced by
The parameter $c is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Comprehensibility introduced by
Avoid variables with short names like $c. Configured minimum length is 3.

Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.

Loading history...
21
            $renderer = new Renderer($config);
22
23
            return $renderer;
24
        };
25
26
        $container['mailRenderer'] = function (Container $c) use ($config) {
0 ignored issues
show
Unused Code introduced by
The parameter $c is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
27
            $renderer = new MailRenderer($config['mailTemplate']);
28
29
            return $renderer;
30
        };
31
    }
32
}
33