InstagramApp   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 52
c 0
b 0
f 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 3
A getId() 0 4 1
A getSecret() 0 4 1
1
<?php
2
/**
3
 * The MIT License (MIT)
4
 *
5
 * Copyright (c) 2016 Haridarshan Gorana
6
 *
7
 * Permission is hereby granted, free of charge, to any person obtaining a copy
8
 * of this software and associated documentation files (the "Software"), to deal
9
 * in the Software without restriction, including without limitation the rights
10
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
 * copies of the Software, and to permit persons to whom the Software is
12
 * furnished to do so, subject to the following conditions:
13
 *
14
 * The above copyright notice and this permission notice shall be included in all
15
 * copies or substantial portions of the Software.
16
 *
17
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
 * SOFTWARE.
24
 */
25
namespace Haridarshan\Instagram;
26
27
use Haridarshan\Instagram\Exceptions\InstagramException;
28
29
/**
30
 * InstagramApp class
31
 *
32
 * @library			instagram-php
33
 *
34
 * @license 		https://opensource.org/licenses/MIT MIT
35
 *
36
 * @link			http://github.com/haridarshan/instagram-php Class Documentation
37
 * @link			http://instagram.com/developer/ API Documentation
38
 *
39
 * @author			Haridarshan Gorana 	<[email protected]>
40
 *
41
 * @since			September 03, 2016
42
 *
43
 * @copyright		Haridarshan Gorana
44
 *
45
 * @version			2.2.2
46
 */
47
class InstagramApp
48
{
49
    /**
50
     * @var string Instagram App ID.
51
     */
52
    protected $id;
53
54
    /**
55
     * @var string Instagram App Secret.
56
     */
57
    protected $secret;
58
59
    /**
60
     * @param string $id
61
     * @param string $secret
62
     *
63
     * @throws InstagramException
64
     */
65
    public function __construct($id, $secret)
66
    {
67
        if (!is_string($id)) {
68
            throw new InstagramException('The "client_id" must be formatted as a string.');
69
        }
70
71
        if (!is_string($secret)) {
72
            throw new InstagramException('The "client_secret" must be formatted as a string.');
73
        }
74
75
        $this->id = $id;
76
        $this->secret = $secret;
77
    }
78
79
    /**
80
     * Returns the app ID.
81
     *
82
     * @return string
83
     */
84
    public function getId()
85
    {
86
        return $this->id;
87
    }
88
89
    /**
90
     * Returns the app secret.
91
     *
92
     * @return string
93
     */
94
    public function getSecret()
95
    {
96
        return $this->secret;
97
    }
98
}
99