WebPageSource   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 9
c 2
b 0
f 0
dl 0
loc 30
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setHandler() 0 3 1
A getHandler() 0 3 1
A __construct() 0 4 1
A getUrl() 0 3 1
A setUrl() 0 3 1
1
<?php
2
3
namespace Coco\SourceWatcher\Watcher\Source;
4
5
use Coco\SourceWatcher\Watcher\Handler\Handler;
6
use Coco\SourceWatcher\Watcher\Handler\WebPageHandler;
7
8
/**
9
 * Class WebPageSource
10
 * @package Coco\SourceWatcher\Watcher\Source
11
 */
12
class WebPageSource implements Source
13
{
14
    protected string $url;
15
16
    protected WebPageHandler $handler;
17
18
    public function __construct ( string $url )
19
    {
20
        $this->url = $url;
21
        $this->handler = new WebPageHandler( $url );
22
    }
23
24
    public function getUrl () : string
25
    {
26
        return $this->url;
27
    }
28
29
    public function setUrl ( string $url ) : void
30
    {
31
        $this->url = $url;
32
    }
33
34
    public function getHandler () : Handler
35
    {
36
        return $this->handler;
37
    }
38
39
    public function setHandler ( Handler $handler ) : void
40
    {
41
        $this->handler = $handler;
42
    }
43
}
44