Completed
Push — master ( 5cec17...25ceca )
by Pascal
03:29 queued 12s
created

Scraper   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 51
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getClient() 0 4 1
A setClient() 0 4 1
A request() 0 4 1
A click() 0 4 1
1
<?php namespace MtGTutor\Console;
2
3
use Goutte\Client;
4
5
/**
6
 * Class Scraper
7
 * @package MtGTutor\Console
8
 */
9
class Scraper
10
{
11
    /**
12
     * @var \Goutte\Client
13
     */
14
    protected $client;
15
16
    /**
17
     * Scraper constructor.
18
     * @param \Goutte\Client $client
19
     */
20
    public function __construct(Client $client)
21
    {
22
        $this->setClient($client);
23
    }
24
25
    /**
26
     * @return \Goutte\Client
27
     */
28
    public function getClient()
29
    {
30
        return $this->client;
31
    }
32
33
    /**
34
     * @param \Goutte\Client $client
35
     */
36
    public function setClient(Client $client)
37
    {
38
        $this->client = $client;
39
    }
40
41
    /**
42
     * @param null   $uri
43
     * @param string $method
44
     * @return \Symfony\Component\DomCrawler\Crawler
45
     */
46
    public function request($uri = null, $method = 'GET')
47
    {
48
        return $this->client->request($method, $uri);
49
    }
50
51
    /**
52
     * @param $link
53
     * @return \Symfony\Component\DomCrawler\Crawler
54
     */
55
    public function click($link)
56
    {
57
        return $this->client->click($link);
58
    }
59
}
60