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 ( 3ad358...33ebf3 )
by Dmitry
35:11
created

Updater::__construct()   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
 * Copyright (C) 2017. iMega ltd Dmitry Gavriloff (email: [email protected]),
4
 *
5
 * This program is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation, either version 3 of the License, or
8
 * (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
 */
18
19
namespace Kubikvest\Resource\User;
20
21
use Kubikvest\Resource\User\Model\User;
22
use Pimple\Container;
23
24
class Updater
25
{
26
    /**
27
     * @var Container
28
     */
29
    private $container;
30
31
    public function __construct(Container $container)
32
    {
33
        $this->container = $container;
34
    }
35
36
    /**
37
     * @param User $user
38
     */
39
    public function update(User $user)
40
    {
41
        /**
42
         * @var Mapper $mapper
43
         */
44
        $mapper = $this->container[Mapper::class];
45
46
        $mapper->update(
47
            [
48
                'user_id'      => $user->getUserId()->getValue(),
49
                'access_token' => $user->getProvider()->token,
50
                'group_id'     => $user->getGroupId()->getValue(),
51
                'ttl'          => $user->getProvider()->ttl,
52
                'start_task'   => '',
53
            ]
54
        );
55
    }
56
}
57