HasRichTextDescription::setDescription()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
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 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Application\Traits;
6
7
use Application\Utility;
8
9
use Doctrine\ORM\Mapping as ORM;
10
11
trait HasRichTextDescription
12
{
13
    #[ORM\Column(type: 'text', length: 65535, options: ['default' => ''])]
14
    private string $description = '';
15
16
    /**
17
     * Set description.
18
     */
19
    public function setDescription(string $description): void
20
    {
21
        $this->description = Utility::sanitizeRichText($description);
22
    }
23
24
    /**
25
     * Get description.
26
     */
27
    public function getDescription(): string
28
    {
29
        return $this->description;
30
    }
31
}
32