SchemaExtension   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 15
ccs 4
cts 6
cp 0.6667
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getPath() 0 3 1
A load() 0 5 1
1
<?php
2
/**
3
 * Schema Validator
4
 *
5
 * @author Vlad Shashkov <[email protected]>
6
 * @copyright Copyright (c) 2021, The Myaza Software
7
 */
8
9
declare(strict_types=1);
10
11
namespace SchemaValidator\DependencyInjection;
12
13
use Symfony\Component\Config\FileLocator;
14
use Symfony\Component\DependencyInjection\ContainerBuilder;
15
use Symfony\Component\DependencyInjection\Extension\Extension;
16
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
17
18
final class SchemaExtension extends Extension
19
{
20
    /**
21
     * @throws \Exception
22
     */
23 10
    public function load(array $configs, ContainerBuilder $container): void
24
    {
25 10
        $loader = new PhpFileLoader($container, new FileLocator(__DIR__ . '/../../config'));
26
27 10
        $loader->load('service.php');
28 10
    }
29
30
    public function getPath(): string
31
    {
32
        return \dirname(__DIR__);
33
    }
34
}
35