Completed
Pull Request — master (#244)
by Benjamin
01:37
created

CrawlUrl::setId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Spatie\Crawler;
4
5
use Psr\Http\Message\UriInterface;
6
7
class CrawlUrl
8
{
9
    /** @var \Psr\Http\Message\UriInterface */
10
    public $url;
11
12
    /** @var \Psr\Http\Message\UriInterface */
13
    public $foundOnUrl;
14
15
    public static function create(UriInterface $url, ?UriInterface $foundOnUrl = null)
16
    {
17
        $static = new static($url, $foundOnUrl);
18
19
        return $static;
20
    }
21
22
    protected function __construct(UriInterface $url, $foundOnUrl = null)
23
    {
24
        $this->url = $url;
25
        $this->foundOnUrl = $foundOnUrl;
26
    }
27
}
28