ContainerFactory::createWithConfig()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 2
b 0
f 0
nc 1
nop 1
dl 0
loc 7
rs 9.4285
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