HasRichTextDescription   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 19
rs 10
c 0
b 0
f 0
ccs 0
cts 4
cp 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setDescription() 0 3 1
A getDescription() 0 3 1
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