Custom   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 23
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 17 1
1
<?php
2
3
namespace Swader\Diffbot\Api;
4
5
use Swader\Diffbot\Abstracts\Api;
6
7
class Custom extends Api
8
{
9
    /** @var string API URL to which to send the request */
10
    protected $apiUrl = 'https://api.diffbot.com/v3';
11
12 6
    public function __construct($url, $name)
13
    {
14
15
        /*
16
        @todo Throw exception for invalid names.
17
        Diffbot HQ will provide regex for invalid chars in API names. Once
18
        done, modify this case to throw exceptions for invalid ones, and write
19
        test cases.
20
21
        Note that all API names with ? and / in their name currently fail to
22
        execute in the Diffbot test runner, so it's questionable whether they're
23
        even supposed to be supported.
24
        */
25
26 6
        parent::__construct($url);
27 6
        $this->apiUrl .= '/' . trim($name);
28 6
    }
29
}
30