GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Dear::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 2
1
<?php
2
3
/**
4
 * Part of Dear package.
5
 *
6
 * @package Dear
7
 * @version 1.0
8
 * @author Umair Mahmood
9
 * @license MIT
10
 * @copyright Copyright (c) 2019 Umair Mahmood
11
 *
12
 */
13
14
namespace UmiMood\Dear;
15
16
class Dear
17
{
18
    /**
19
     * @var Dear
20
     */
21
    protected static $instance;
22
23
    /**
24
     * @var Config
25
     */
26
    protected $config;
27
28
    /**
29
     * Dear constructor.
30
     * @param string $accountId
31
     * @param string $applicationKey
32
     */
33
    protected function __construct($accountId = null, $applicationKey = null)
34
    {
35
        $this->config = new Config($accountId, $applicationKey);
36
    }
37
38
    /**
39
     * @param string $accountId
40
     * @param string $applicationKey
41
     * @return Dear
42
     */
43
    public static function create($accountId = null, $applicationKey = null)
44
    {
45
        return (static::$instance) ? static::$instance : new static($accountId, $applicationKey);
46
    }
47
48
    /**
49
     * @param $name
50
     * @param $arguments
51
     * @return mixed
52
     */
53
    public function __call($name, $arguments)
54
    {
55
        $class = "\\UmiMood\\Dear\\Api\\" . ucwords($name);
56
        if (class_exists($class)) {
57
            return new $class($this->config);
58
        }
59
60
        throw new \BadMethodCallException("undefined method $name called.");
61
    }
62
}
63