Completed
Push — master ( 00c88c...56f5c3 )
by Rémi
13s
created

CrawlerAbstract::getUrlParser()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Lbc\Crawler;
4
5
use Symfony\Component\DomCrawler\Crawler;
6
7
/**
8
 * Class CrawlerAbstract
9
 * @package Lbc\Crawler
10
 */
11
abstract class CrawlerAbstract
12
{
13
    /**
14
     * @var string
15
     */
16
    protected $sheme = 'https';
17
18
    /**
19
     * @var Crawler
20
     */
21
    protected $node;
22
23
    /**
24
     * @var
25
     */
26
    protected $url;
27
28
    /**
29
     * CrawlerAbstract constructor.
30
     * @param Crawler $node
31
     * @param $url
32
     */
33 28
    public function __construct(Crawler $node, $url)
34
    {
35 28
        $this->node = $node;
36
37 28
        $this->setUrlParser($url);
38 28
    }
39
40
    /**
41
     * Return the current node
42
     *
43
     * @return Crawler
44
     */
45 2
    public function getCrawler()
46
    {
47 2
        return $this->node;
48
    }
49
50
    /**
51
     * @return mixed
52
     */
53 10
    public function getUrlParser()
54
    {
55 10
        return $this->url;
56
    }
57
58
    /**
59
     * @param $url
60
     * @return mixed
61
     */
62
    abstract protected function setUrlParser($url);
63
}
64