BlockEvent   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 24
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getName() 0 3 2
A getBlock() 0 3 1
1
<?php
2
namespace gossi\formatter\events;
3
4
use gossi\formatter\entities\Block;
5
use phootwork\tokenizer\Token;
6
7
class BlockEvent extends TokenEvent {
8
9
	/** @var Block */
10
	private $block;
11
12 10
	public function __construct(Token $token, Block $block) {
13 10
		parent::__construct($token);
14 10
		$this->block = $block;
15 10
	}
16
17 1
	public function getName() {
18 1
		return 'context.block_' . ($this->block->end === null ? 'enter' : 'leave');
19
	}
20
21
	/**
22
	 * Returns the associated block
23
	 *
24
	 * @return Block
25
	 */
26 10
	public function getBlock() {
27 10
		return $this->block;
28
	}
29
30
}
31