Url::removeUrl()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Zwarthoorn\Ping\Entity;
6
7
8
class Url
9
{
10
    private $url;
11
12
    /**
13
     * @return mixed
14
     */
15
    public function getUrl() :array
16
    {
17
        return $this->url;
18
    }
19
20
    /**
21
     * @param mixed $url
22
     * @return url
23
     */
24
    public function addUrl($url): self
25
    {
26
        $this->url[] = $url;
27
        return $this;
28
    }
29
30
    public function removeUrl($result): self
31
    {
32
        unset($this->url[array_search($result, $this->url,[FALSE])]);
0 ignored issues
show
Bug introduced by
array(FALSE) of type array<integer,false> is incompatible with the type boolean expected by parameter $strict of array_search(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

32
        unset($this->url[array_search($result, $this->url,/** @scrutinizer ignore-type */ [FALSE])]);
Loading history...
33
34
        return $this;
35
    }
36
}