Completed
Push — master ( dd8e38...78075d )
by Thomas
04:27
created

BlockEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 4
cts 4
cp 1
rs 10
cc 1
eloc 3
nc 1
nop 2
crap 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
	public function getName() {
18
		return 'context.block_' . ($this->block->end === null ? 'enter' : 'leave');
19
	}
20
21
	/**
22 10
	 * Returns the associated block
23 10
	 *
24
	 * @return Block
25
	 */
26
	public function getBlock() {
27
		return $this->block;
28
	}
29
30
}
31