Completed
Push — master ( 61c1b2...61092d )
by Javier
08:21
created

XgcCarbonExtension   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getAlias() 0 3 1
A load() 0 4 2
1
<?php
2
declare(strict_types=1);
3
4
namespace Xgc\CarbonBundle\DependencyInjection;
5
6
use Carbon\Carbon;
7
use Exception;
8
use Symfony\Component\DependencyInjection\ContainerBuilder;
9
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
10
11
/**
12
 * Class XgcCarbonExtension
13
 * @package Xgc\CarbonBundle\DependencyInjection
14
 */
15
class XgcCarbonExtension extends Extension
16
{
17
    /**
18
     * @param array            $configs
19
     * @param ContainerBuilder $container
20
     *
21
     * @throws Exception
22
     */
23
    public function load(array $configs, ContainerBuilder $container): void
24
    {
25
        if (!$container->hasParameter('encoding')) {
26
            $container->setParameter('encoding', 'utf8');
27
        }
28
    }
29
30
    /**
31
     * @return string
32
     */
33
    public function getAlias(): string
34
    {
35
        return 'xgc_carbon';
36
    }
37
}
38