Passed
Push — develop ( 0f5d99...ddb92e )
by BENARD
04:38
created

PlayerMethodsTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 20
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setPlayer() 0 4 1
A getPlayer() 0 3 1
1
<?php
2
3
namespace VideoGamesRecords\CoreBundle\Model\Entity\Player;
4
5
use VideoGamesRecords\CoreBundle\Entity\Player;
6
7
trait PlayerMethodsTrait
8
{
9
    /**
10
     * @param Player $player
11
     * @return $this
12
     */
13
    public function setPlayer(Player $player): static
14
    {
15
        $this->player = $player;
0 ignored issues
show
Bug Best Practice introduced by
The property player does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
16
        return $this;
17
    }
18
19
    /**
20
     * Get player
21
     *
22
     * @return Player
23
     */
24
    public function getPlayer(): Player
25
    {
26
        return $this->player;
27
    }
28
}
29