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 ( fbf98a...c5e9e2 )
by Hong
02:08
created

Delegator::isValidContainer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
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
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 isValidContainer($container)/*# : bool */
60
    {
61
        return $container instanceof ConfigInterface;
62
    }
63
64
    /**
65
     * {@inheritDoc}
66
     */
67
    protected function hasInContainer(
68
        $container,
69
        /*# string */ $key
70
    )/*# : bool */ {
71
        /* @var $container ConfigInterface */
72
        return $container->has($key);
73
    }
74
75
    /**
76
     * {@inheritDoc}
77
     */
78
    protected function getFromContainer(
79
        $container,
80
        /*# string */ $key
81
    ) {
82
        /* @var $container ConfigInterface */
83
        return $container->get($key);
84
    }
85
}
86