Issues (97)

src/Entity/Setting.php (1 issue)

1
<?php
2
3
namespace App\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
7
use Symfony\Component\Validator\Constraints as Assert;
8
9
#[ORM\Entity]
10
#[UniqueEntity(fields: ['key'])]
11
class Setting {
12
13
    #[ORM\Id]
14
    #[ORM\Column(name: 'key', type: 'string', unique: true)]
15
    #[Assert\NotBlank]
16
    private ?string $key = null;
17
18
    /**
19
     * @var mixed
20
     */
21
    #[ORM\Column(type: 'object')]
22
    private $value = null;
23
24
    public function getKey(): string {
25
        return $this->key;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->key could return the type null which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.
Loading history...
26
    }
27
28
    public function setKey(string $key): Setting {
29
        $this->key = $key;
30
        return $this;
31
    }
32
33
    /**
34
     * @return mixed
35
     */
36
    public function getValue() {
37
        return $this->value;
38
    }
39
40
    /**
41
     * @return Setting
42
     */
43
    public function setValue(mixed $value) {
44
        $this->value = $value;
45
        return $this;
46
    }
47
}