Completed
Push — master ( 70332f...878d6e )
by Freek
01:16
created

SearchResult::url()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Spatie\Searchable;
4
5
class SearchResult
6
{
7
    /** @var string */
8
    public $title;
9
10
    /** @var null|string */
11
    public $url;
12
13
    /** @var string */
14
    public $type;
15
16
    /** @var \Spatie\Searchable\Searchable */
17
    public $result;
18
19
    public function __construct(string $title, ?string $url = null)
20
    {
21
        $this->title = $title;
22
23
        $this->url = $url;
24
    }
25
26
    public function setType(string $type): self
27
    {
28
        $this->type = $type;
29
30
        return $this;
31
    }
32
33
    public function setResult(Searchable $result): self
34
    {
35
        $this->result = $result;
36
37
        return $this;
38
    }
39
}
40