Passed
Pull Request — master (#1918)
by Janko
25:50
created

UserTutorial::setTutorialStep()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
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;
0 ignored issues
show
Bug introduced by
The type Override was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
use Stu\Orm\Repository\UserTutorialRepository;
15
16
#[Table(name: 'stu_user_tutorial')]
17
#[Entity(repositoryClass: UserTutorialRepository::class)]
18
class UserTutorial implements UserTutorialInterface
19
{
20
    #[Id]
21
    #[Column(type: 'integer')]
22
    private int $user_id;
23
24
    #[Id]
25
    #[Column(type: 'integer')]
26
    private int $tutorial_step_id;
27
28
    #[ManyToOne(targetEntity: 'User', inversedBy: 'tutorials')]
29
    #[JoinColumn(name: 'user_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
30
    private UserInterface $user;
31
32
    #[ManyToOne(targetEntity: 'TutorialStep')]
33
    #[JoinColumn(name: 'tutorial_step_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
34
    private TutorialStepInterface $tutorialStep;
35
36
    #[Override]
37
    public function getUser(): UserInterface
38
    {
39
        return $this->user;
40
    }
41
42
    #[Override]
43
    public function setUser(UserInterface $user): UserTutorialInterface
44
    {
45
        $this->user = $user;
46
        return $this;
47
    }
48
49
    #[Override]
50
    public function getTutorialStep(): TutorialStepInterface
51
    {
52
        return $this->tutorialStep;
53
    }
54
55
    #[Override]
56
    public function setTutorialStep(TutorialStepInterface $tutorialStep): UserTutorialInterface
57
    {
58
        $this->tutorialStep = $tutorialStep;
59
        return $this;
60
    }
61
62
    #[Override]
63
    public function setUserId(int $userId): void
64
    {
65
        $this->user_id = $userId;
66
    }
67
68
    #[Override]
69
    public function setTutorialStepId(int $stepId): void
70
    {
71
        $this->tutorial_step_id = $stepId;
72
    }
73
}
74