WithGroups::getGroups()   A
last analyzed

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