HasUrl::getUrl()   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 Ecodev\Felix\Model\Traits;
6
7
use Doctrine\ORM\Mapping as ORM;
8
use GraphQL\Doctrine\Attribute as API;
9
10
/**
11
 * Trait for all objects with an URL.
12
 */
13
trait HasUrl
14
{
15
    #[ORM\Column(type: 'string', length: 2000, options: ['default' => ''])]
16
    private string $url = '';
17
18
    /**
19
     * Set url.
20
     */
21
    #[API\Input(type: 'Url')]
22
    public function setUrl(string $url): void
23
    {
24
        $this->url = $url;
25
    }
26
27
    /**
28
     * Get url.
29
     */
30
    #[API\Field(type: 'Url')]
31
    public function getUrl(): string
32
    {
33
        return $this->url;
34
    }
35
}
36