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

GroupEvent   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

3 Methods

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