ServiceProvider::getIcon()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
ccs 0
cts 1
cp 0
crap 2
1
<?php
2
3
namespace App\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Ramsey\Uuid\Uuid;
7
use Symfony\Component\Validator\Constraints as Assert;
8
9
#[ORM\Entity]
10
#[ORM\InheritanceType('SINGLE_TABLE')]
11
#[ORM\DiscriminatorColumn(name: 'class', type: 'string')]
12
#[ORM\DiscriminatorMap(['saml' => 'SamlServiceProvider', 'normal' => 'ServiceProvider'])]
13
class ServiceProvider {
14
15
    use IdTrait;
16
    use UuidTrait;
17
18
    #[ORM\Column(type: 'string')]
19
    #[Assert\NotBlank]
20
    private $name;
21
22
    #[ORM\Column(type: 'text')]
23
    #[Assert\NotBlank]
24
    private $description;
25
26
    #[ORM\Column(type: 'text')]
27
    #[Assert\NotBlank]
28
    #[Assert\Url]
29
    private $url;
30
31
    #[ORM\Column(type: 'text', nullable: true)]
32
    #[Assert\NotBlank(allowNull: true)]
33
    private ?string $icon = null;
34
35
    public function __construct() {
36
        $this->uuid = Uuid::uuid4();
37
    }
38
39
    /**
40
     * @return string
41
     */
42
    public function getName() {
43
        return $this->name;
44
    }
45
46
    /**
47
     * @param string $name
48
     * @return ServiceProvider
49
     */
50
    public function setName($name) {
51
        $this->name = $name;
52
        return $this;
53
    }
54
55
    /**
56
     * @return string
57
     */
58
    public function getDescription() {
59
        return $this->description;
60
    }
61
62
    /**
63
     * @param string $description
64
     * @return ServiceProvider
65
     */
66
    public function setDescription($description) {
67
        $this->description = $description;
68
        return $this;
69
    }
70
71
    /**
72
     * @return string
73
     */
74
    public function getUrl() {
75
        return $this->url;
76
    }
77
78
    /**
79
     * @param string $url
80
     * @return ServiceProvider
81
     */
82
    public function setUrl($url) {
83
        $this->url = $url;
84
        return $this;
85
    }
86
87
    public function getIcon(): ?string {
88
        return $this->icon;
89
    }
90
91
    public function setIcon(?string $icon): ServiceProvider {
92
        $this->icon = $icon;
93
        return $this;
94
    }
95
96
}