ContainerFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 4
Bugs 0 Features 1
Metric Value
wmc 2
c 4
b 0
f 1
lcom 0
cbo 1
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 4 1
A createWithConfig() 0 7 1
1
<?php
2
3
namespace Symnedi\EventDispatcher\Tests;
4
5
use Nette\Configurator;
6
use Nette\DI\Container;
7
8
9
final class ContainerFactory
10
{
11
12
	/**
13
	 * @return Container
14
	 */
15
	public function create()
16
	{
17
		return $this->createWithConfig(__DIR__ . '/config/default.neon');
18
	}
19
20
21
	/**
22
	 * @param string $config
23
	 * @return Container
24
	 */
25
	public function createWithConfig($config)
26
	{
27
		$configurator = new Configurator;
28
		$configurator->setTempDirectory(TEMP_DIR);
29
		$configurator->addConfig($config);
30
		return $configurator->createContainer();
31
	}
32
33
}
34