Total Complexity | 3 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Coverage | 50% |
Changes | 0 |
1 | <?php |
||
11 | class IsGdShortener extends RemoteShortener implements CustomUrls |
||
12 | { |
||
13 | use Concerns\CreatesCustomUrls; |
||
14 | |||
15 | protected $client; |
||
16 | protected $defaults; |
||
17 | |||
18 | /** |
||
19 | * Create a new Is.gd shortener. |
||
20 | * |
||
21 | * @param \GuzzleHttp\ClientInterface $client |
||
22 | * @param \Psr\Http\Message\UriInterface|string $baseUri |
||
23 | * @param bool $statistics |
||
24 | * @return void |
||
25 | */ |
||
26 | 48 | public function __construct(ClientInterface $client, $baseUri, bool $statistics) |
|
27 | { |
||
28 | 48 | $this->client = $client; |
|
29 | 48 | $this->defaults = [ |
|
30 | 48 | 'allow_redirects' => false, |
|
31 | 48 | 'base_uri' => (string)$baseUri, |
|
32 | 'query' => [ |
||
33 | 48 | 'format' => 'simple', |
|
34 | 48 | 'logstats' => intval($statistics), |
|
35 | ], |
||
36 | ]; |
||
37 | 48 | } |
|
38 | |||
39 | /** |
||
40 | * {@inheritDoc} |
||
41 | */ |
||
42 | public function shortenAsync($url, array $options = []) |
||
49 | }); |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * {@inheritDoc} |
||
54 | */ |
||
55 | public function shortenToAsync($url, string $identifier, array $options = []) |
||
60 |