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.

Container::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Teebot\Configuration;
6
7
use Teebot\Configuration\ValueObject\EventConfig;
8
9
class Container extends AbstractContainer
10
{
11
    const ENV_PREFIX = 'TEEBOT__';
12
13
    public function __construct(array $config)
14
    {
15
        parent::__construct($config);
16
17
        $this->values['events'] = $this->hydrateEventConfigItems($this->values['events']);
18
    }
19
20
    /**
21
     * Creates an event configuration item value objects from plain arrays
22
     *
23
     * @param array $events
24
     *
25
     * @return array
26
     */
27
    protected function hydrateEventConfigItems(array $events)
28
    {
29
        $hydratedEvents = [];
30
31
        foreach ($events as $event) {
32
            $hydratedEvents[] = new EventConfig($event);
33
        }
34
35
        return $hydratedEvents;
36
    }
37
}
38