Passed
Pull Request — master (#510)
by Alejandro
06:36
created

UrlShortenerOptions   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 17
rs 10
c 1
b 0
f 0
ccs 5
cts 5
cp 1
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A isUrlValidationEnabled() 0 3 1
A setValidateUrl() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Shlinkio\Shlink\Core\Options;
6
7
use Zend\Stdlib\AbstractOptions;
8
9
class UrlShortenerOptions extends AbstractOptions
10
{
11
    // phpcs:disable
12
    protected $__strictMode__ = false;
13
    // phpcs:enable
14
15
    private $validateUrl = true;
16
17 5
    public function isUrlValidationEnabled(): bool
18
    {
19 5
        return $this->validateUrl;
20
    }
21
22 15
    protected function setValidateUrl($validateUrl): self
23
    {
24 15
        $this->validateUrl = (bool) $validateUrl;
25 15
        return $this;
26
    }
27
}
28