ResultPage   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 82.35%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 2
dl 0
loc 53
c 0
b 0
f 0
ccs 14
cts 17
cp 0.8235
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getUid() 0 4 1
A setUid() 0 4 1
A generateCrawler() 0 10 1
A getCrawlerUri() 0 5 1
1
<?php
2
3
namespace Sportic\Timing\RaceTecClient\Scrapers;
4
5
use Sportic\Timing\RaceTecClient\Parsers\ResultPage as Parser;
6
use Symfony\Component\DomCrawler\Crawler;
7
8
/**
9
 * Class CompanyPage
10
 * @package Sportic\Timing\RaceTecClient\Scrapers
11
 *
12
 * @method Parser execute()
13
 */
14
class ResultPage extends AbstractScraper
15
{
16
    protected $uid;
17
18
    /**
19
     * ResultPage constructor.
20
     *
21
     * @param $uid
22
     */
23 2
    public function __construct($uid)
24
    {
25 2
        $this->uid = $uid;
26 2
    }
27
28
    /**
29
     * @return mixed
30
     */
31 2
    public function getUid()
32
    {
33 2
        return $this->uid;
34
    }
35
36
    /**
37
     * @param mixed $uid
38
     */
39
    public function setUid($uid)
40
    {
41
        $this->uid = $uid;
42
    }
43
44
    /**
45
     * @inheritdoc
46
     */
47 2
    protected function generateCrawler()
48
    {
49 2
        $client  = $this->getClient();
50 2
        $crawler = $client->request(
51 2
            'GET',
52 2
            $this->getCrawlerUri()
53
        );
54
55 2
        return $crawler;
56
    }
57
58
    /**
59
     * @return Crawler
60
     */
61 2
    public function getCrawlerUri()
62
    {
63 2
        return $this->getCrawlerUriHost().'/MyResults.aspx?'
64 2
               . 'uid=' . $this->getUid();
65
    }
66
}
67