HasColor::getColor()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Application\Traits;
6
7
use Doctrine\ORM\Mapping as ORM;
8
use Ecodev\Felix\Api\Scalar\ColorType;
9
use GraphQL\Doctrine\Attribute as API;
10
11
trait HasColor
12
{
13
    #[ORM\Column(type: 'string', length: 7, options: ['default' => ''])]
14
    private string $color = '';
15
16
    /**
17
     * Set color.
18
     */
19
    #[API\Input(type: ColorType::class)]
20
    public function setColor(string $color): void
21
    {
22
        $this->color = $color;
23
    }
24
25
    /**
26
     * Get color.
27
     */
28
    #[API\Field(type: ColorType::class)]
29
    public function getColor(): string
30
    {
31
        return $this->color;
32
    }
33
}
34