App   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 6
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
c 6
b 0
f 0
dl 0
loc 18
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getOAuthApp() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
// App.php
4
#################################################
5
##
6
## PHPLicengine
7
##
8
#################################################
9
## Copyright 2009-{current_year} PHPLicengine
10
## 
11
## Licensed under the Apache License, Version 2.0 (the "License");
12
## you may not use this file except in compliance with the License.
13
## You may obtain a copy of the License at
14
##
15
##    http://www.apache.org/licenses/LICENSE-2.0
16
##
17
## Unless required by applicable law or agreed to in writing, software
18
## distributed under the License is distributed on an "AS IS" BASIS,
19
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
## See the License for the specific language governing permissions and
21
## limitations under the License.
22
#################################################
23
24
// IMPORTANT NOTE: This class remains here for backward compatibility. Please use OAuth class instead.
25
26
namespace PHPLicengine\Service;
27
use PHPLicengine\Exception\ResponseException;
28
use PHPLicengine\Exception\CurlException;
29
use PHPLicengine\Api\ApiInterface;
30
31
class App {
32
 
33
       private $url;
34
       private $api;
35
 
36
       public function __construct(ApiInterface $api)
37
       {
38
              $this->api = $api;
39
              $this->url = 'https://api-ssl.bitly.com/v4/apps';       
40
       }
41
 
42
       /*
43
       Retrieve OAuth App
44
       https://dev.bitly.com/v4/#operation/getOAuthApp
45
       */
46
       public function getOAuthApp(string $client_id) 
47
       {
48
              return $this->api->get($this->url.'/'.$client_id);
49
       }
50
      
51
}
52