Completed
Pull Request — master (#506)
by Alejandro
13:13
created

UrlShortenerOptions::setValidateUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1.125

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 1
cts 2
cp 0.5
crap 1.125
rs 10
c 1
b 0
f 0
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
    public function isUrlValidationEnabled(): bool
18
    {
19
        return $this->validateUrl;
20 4
    }
21
22 4
    protected function setValidateUrl($validateUrl): self
23
    {
24
        $this->validateUrl = (bool) $validateUrl;
25
        return $this;
26
    }
27
}
28