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.
Completed
Push — master ( 3c112e...7b66c6 )
by Hong
02:53
created

Delegator::isValidRegistry()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * Phossa Project
4
 *
5
 * PHP version 5.4
6
 *
7
 * @category  Library
8
 * @package   Phossa2\Config
9
 * @copyright Copyright (c) 2016 phossa.com
10
 * @license   http://mit-license.org/ MIT License
11
 * @link      http://www.phossa.com/
12
 */
13
/*# declare(strict_types=1); */
14
15
namespace Phossa2\Config;
16
17
use Phossa2\Shared\Base\ObjectAbstract;
18
use Phossa2\Shared\Reference\DelegatorTrait;
19
use Phossa2\Shared\Reference\DelegatorInterface;
20
21
/**
22
 * Delegator
23
 *
24
 * Implmentation of DelegatorInterface
25
 *
26
 * @package Phossa2\Config
27
 * @author  Hong Zhang <[email protected]>
28
 * @see     ObjectAbstract
29
 * @see     DelegatorInterface
30
 * @version 2.0.0
31
 * @since   2.0.0 added
32
 */
33
class Delegator extends ObjectAbstract implements DelegatorInterface, ConfigInterface
0 ignored issues
show
Bug introduced by
There is at least one abstract method in this class. Maybe declare it as abstract, or implement the remaining methods: getFromContainer, hasInContainer, isValidContainer
Loading history...
34
{
35
    use DelegatorTrait;
36
37
    /**
38
     * {@inheritDoc}
39
     */
40
    public function get(/*# string */ $key, $default = null)
41
    {
42
        if ($this->hasInLookup($key)) {
43
            return $this->getFromLookup($key);
44
        }
45
        return $default;
46
    }
47
48
    /**
49
     * {@inheritDoc}
50
     */
51
    public function has(/*# string */ $key)/*# : bool */
52
    {
53
        return $this->hasInLookup($key);
54
    }
55
56
    /**
57
     * {@inheritDoc}
58
     */
59
    protected function isValidRegistry($registry)/*# : bool */
60
    {
61
        return $registry instanceof ConfigInterface;
62
    }
63
64
    /**
65
     * {@inheritDoc}
66
     */
67
    protected function hasInRegistry(
68
        $registry,
69
        /*# string */ $key
70
    )/*# : bool */ {
71
        /* @var $registry ConfigInterface */
72
        return $registry->has($key);
73
    }
74
75
    /**
76
     * {@inheritDoc}
77
     */
78
    protected function getFromRegistry(
79
        $registry,
80
        /*# string */ $key
81
    ) {
82
        /* @var $registry ConfigInterface */
83
        return $registry->get($key);
84
    }
85
}
86