Completed
Push — master ( a743c4...8e8354 )
by Tomáš
02:35
created

WithGroups   A

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