Passed
Push — master ( fbb10f...c0768e )
by Vlad
03:01
created

SchemaExtension::load()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
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