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

WithGroups::queryGroups()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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
}