SearchResult   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 30
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A setType() 0 6 1
1
<?php
2
3
namespace Spatie\Searchable;
4
5
class SearchResult
6
{
7
    /** @var \Spatie\Searchable\Searchable */
8
    public $searchable;
9
10
    /** @var string */
11
    public $title;
12
13
    /** @var null|string */
14
    public $url;
15
16
    /** @var string */
17
    public $type;
18
19
    public function __construct(Searchable $searchable, string $title, ?string $url = null)
20
    {
21
        $this->searchable = $searchable;
22
23
        $this->title = $title;
24
25
        $this->url = $url;
26
    }
27
28
    public function setType(string $type): self
29
    {
30
        $this->type = $type;
31
32
        return $this;
33
    }
34
}
35