AbstractCompilerExtensionPass   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 33
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A attach() 0 6 1
A startup() 0 3 1
A stopPropagation() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SixtyEightPublishers\User\DI;
6
7
use ArrayObject;
8
use Nette\DI\CompilerExtension;
9
use SixtyEightPublishers\User\Common\Exception\StopPropagationException;
10
11
abstract class AbstractCompilerExtensionPass extends CompilerExtension implements CompilerExtensionPassInterface
12
{
13
	/** @var \Nette\DI\CompilerExtension|NULL */
14
	protected $parent;
15
16
	/** @var ArrayObject|NULL */
17
	protected $sharedData;
18
19
	/**
20
	 * {@inheritDoc}
21
	 */
22
	public function attach(CompilerExtension $extension, ArrayObject $sharedData): void
23
	{
24
		$this->parent = $extension;
25
		$this->sharedData = $sharedData;
26
		$this->initialization = $extension->getInitialization();
27
	}
28
29
	/**
30
	 * {@inheritDoc}
31
	 */
32
	public function startup(): void
33
	{
34
	}
35
36
	/**
37
	 * @return void
38
	 */
39
	protected function stopPropagation(): void
40
	{
41
		throw new StopPropagationException();
42
	}
43
}
44