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
Pull Request — master (#177)
by Eric
05:49 queued 03:32
created

PlacePhotoService::process()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Ivory Google Map package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ivory\GoogleMap\Service\Place\Photo;
13
14
use Http\Client\HttpClient;
15
use Http\Message\MessageFactory;
16
use Ivory\GoogleMap\Service\Place\AbstractPlaceService;
17
use Ivory\GoogleMap\Service\Place\Photo\Request\PlacePhotoRequestInterface;
18
use Psr\Http\Message\StreamInterface;
19
20
/**
21
 * @author GeLo <[email protected]>
22
 */
23
class PlacePhotoService extends AbstractPlaceService
24
{
25
    /**
26
     * @param HttpClient     $client
27
     * @param MessageFactory $messageFactory
28
     */
29
    public function __construct(HttpClient $client, MessageFactory $messageFactory)
30
    {
31
        parent::__construct($client, $messageFactory, 'photo');
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function setHttps($https)
38
    {
39
        if (!$https) {
40
            throw new \InvalidArgumentException('The http scheme is not supported.');
41
        }
42
43
        parent::setHttps($https);
44
    }
45
46
    /**
47
     * @param PlacePhotoRequestInterface $request
48
     *
49
     * @return StreamInterface
50
     */
51
    public function process(PlacePhotoRequestInterface $request)
52
    {
53
        $httpRequest = $this->createRequest($request);
54
        $httpResponse = $this->getClient()->sendRequest($httpRequest);
55
56
        return $httpResponse->getBody();
57
    }
58
}
59