Scoopit   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 1
cbo 1
dl 0
loc 39
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A shareUrl() 0 7 1
A shareCountRequest() 0 10 1
A shareCount() 0 8 1
1
<?php
2
3
namespace SocialLinks\Providers;
4
5
class Scoopit extends ProviderBase implements ProviderInterface
6
{
7
    /**
8
     * {@inheritdoc}
9
     */
10
    public function shareUrl()
11
    {
12
        return $this->buildUrl(
13
            'https://www.scoop.it/bookmarklet',
14
            array('url')
15
        );
16
    }
17
18
    /**
19
     * {@inheritdoc}
20
     */
21
    public function shareCountRequest()
22
    {
23
        return static::request(
24
            $this->buildUrl(
25
                'http://www.scoop.it/button',
26
                array('url'),
27
                array('position' => 'horizontal')
28
            )
29
        );
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function shareCount($response)
36
    {
37
        $document = static::htmlResponse($response);
38
39
        $count = $document->getElementById('scoopit_count');
40
41
        return (int) $count->nodeValue;
42
    }
43
}
44