Completed
Push — master ( 742ff7...9d59a2 )
by Nikola
09:00
created

ConfigurableDiContainerFactory::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Phoundation\DependencyInjection;
6
7
use Psr\Container\ContainerInterface;
8
9
abstract class ConfigurableDiContainerFactory implements DiContainerFactory
10
{
11
    public function create(array $config): ContainerInterface
12
    {
13
        $container = $this->newInstance();
14
15
        $this->configure($container, $config);
16
17
        return $container;
18
    }
19
20
    abstract protected function newInstance(): ContainerInterface;
21
22
    abstract protected function configure(ContainerInterface $container, array $config): void;
23
}
24