HasUrl   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
eloc 7
c 2
b 0
f 0
dl 0
loc 21
ccs 0
cts 4
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getUrl() 0 4 1
A setUrl() 0 4 1
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