|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Stu\Orm\Entity; |
|
6
|
|
|
|
|
7
|
|
|
use Doctrine\ORM\Mapping\Column; |
|
8
|
|
|
use Doctrine\ORM\Mapping\Entity; |
|
9
|
|
|
use Doctrine\ORM\Mapping\Id; |
|
10
|
|
|
use Doctrine\ORM\Mapping\JoinColumn; |
|
11
|
|
|
use Doctrine\ORM\Mapping\ManyToOne; |
|
12
|
|
|
use Doctrine\ORM\Mapping\Table; |
|
13
|
|
|
use Override; |
|
|
|
|
|
|
14
|
|
|
use Stu\Component\Crew\CrewPositionEnum; |
|
15
|
|
|
use Stu\Component\Crew\Skill\CrewSkillLevelEnum; |
|
|
|
|
|
|
16
|
|
|
use Stu\Orm\Repository\CrewSkillRepository; |
|
17
|
|
|
|
|
18
|
|
|
#[Table(name: 'stu_crew_skill')] |
|
19
|
|
|
#[Entity(repositoryClass: CrewSkillRepository::class)] |
|
20
|
|
|
class CrewSkill implements CrewSkillInterface |
|
21
|
|
|
{ |
|
22
|
|
|
#[Id] |
|
23
|
|
|
#[Column(type: 'integer')] |
|
24
|
|
|
private int $crew_id; |
|
25
|
|
|
|
|
26
|
|
|
#[Id] |
|
27
|
|
|
#[Column(type: 'smallint', enumType: CrewPositionEnum::class)] |
|
28
|
|
|
private CrewPositionEnum $position; |
|
29
|
|
|
|
|
30
|
|
|
#[Column(type: 'integer')] |
|
31
|
|
|
private int $expertise = 0; |
|
32
|
|
|
|
|
33
|
|
|
#[ManyToOne(targetEntity: 'Crew')] |
|
34
|
|
|
#[JoinColumn(name: 'crew_id', referencedColumnName: 'id', onDelete: 'CASCADE')] |
|
35
|
|
|
private CrewInterface $crew; |
|
36
|
|
|
|
|
37
|
1 |
|
#[Override] |
|
38
|
|
|
public function getPosition(): CrewPositionEnum |
|
39
|
|
|
{ |
|
40
|
1 |
|
return $this->position; |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
#[Override] |
|
44
|
|
|
public function setPosition(CrewPositionEnum $position): CrewSkillInterface |
|
45
|
|
|
{ |
|
46
|
|
|
$this->position = $position; |
|
47
|
|
|
|
|
48
|
|
|
return $this; |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
#[Override] |
|
52
|
|
|
public function getCrew(): CrewInterface |
|
53
|
|
|
{ |
|
54
|
|
|
return $this->crew; |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
#[Override] |
|
58
|
|
|
public function setCrew(CrewInterface $crew): CrewSkillInterface |
|
59
|
|
|
{ |
|
60
|
|
|
$this->crew = $crew; |
|
61
|
|
|
$this->crew_id = $crew->getId(); |
|
62
|
|
|
|
|
63
|
|
|
return $this; |
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
|
|
#[Override] |
|
67
|
|
|
public function increaseExpertise(int $amount): void |
|
68
|
|
|
{ |
|
69
|
|
|
$this->expertise += $amount; |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
1 |
|
#[Override] |
|
73
|
|
|
public function getExpertise(): int |
|
74
|
|
|
{ |
|
75
|
1 |
|
return $this->expertise; |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
1 |
|
#[Override] |
|
79
|
|
|
public function getRank(): CrewSkillLevelEnum |
|
80
|
|
|
{ |
|
81
|
1 |
|
return CrewSkillLevelEnum::getForExpertise($this->expertise); |
|
82
|
|
|
} |
|
83
|
|
|
} |
|
84
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths