WithGroups   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 19
ccs 4
cts 4
cp 1
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getGroups() 0 2 1
A queryGroups() 0 2 1
1
<?php
2
3
4
namespace TournamentGenerator\Traits;
5
6
7
use TournamentGenerator\Containers\ContainerQuery;
8
use TournamentGenerator\Group;
9
10
/**
11
 * Trait WithGroups
12
 *
13
 * @package TournamentGenerator\Traits
14
 * @author  Tomáš Vojík <[email protected]>
15
 * @since   0.4
16
 */
17
trait WithGroups
18
{
19
20
	/**
21
	 * Get all groups in this object
22
	 *
23
	 * @return Group[]
24
	 */
25 71
	public function getGroups() : array {
26 71
		return $this->container->getHierarchyLevel(Group::class);
27
	}
28
29
	/**
30
	 * Get groups container query
31
	 *
32
	 * @return ContainerQuery
33
	 */
34 6
	public function queryGroups() : ContainerQuery {
35 6
		return $this->container->getHierarchyLevelQuery(Group::class);
36
	}
37
}