Completed
Push — master ( bd8e6e...a6db71 )
by Jonas
03:36
created

Game   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getAchievements() 0 4 1
A getId() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of SteamScore.
7
 *
8
 * (c) SteamScore <[email protected]>
9
 *
10
 * This Source Code Form is subject to the terms of the Mozilla Public
11
 * License, v. 2.0. If a copy of the MPL was not distributed with this
12
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
13
 */
14
15
namespace SteamScore\Api\Domain\Entities;
16
17
use Doctrine\Common\Collections\ArrayCollection;
18
use Doctrine\Common\Collections\Collection;
19
use Ramsey\Uuid\Uuid;
20
use Ramsey\Uuid\UuidInterface;
21
22
final class Game
23
{
24
    /**
25
     * @var Collection
26
     */
27
    private $achievements;
28
29
    /**
30
     * @var UuidInterface
31
     */
32
    private $id;
33
34
    /**
35
     * Constructor.
36
     */
37 8
    public function __construct()
38
    {
39 8
        $this->achievements = new ArrayCollection();
40 8
        $this->id = Uuid::uuid4();
41
    }
42
43
    /**
44
     * Gets all achievements that belongs to the game.
45
     *
46
     * @return Collection
47
     */
48 2
    public function getAchievements() : Collection
49
    {
50 2
        return $this->achievements;
51
    }
52
53
    /**
54
     * Gets the unique identifier.
55
     *
56
     * @return UuidInterface
57
     */
58 2
    public function getId() : UuidInterface
59
    {
60 2
        return $this->id;
61
    }
62
}
63