Passed
Push — feature/v4 ( 0faea2...b8b3da )
by Samuel
04:35
created

AbstractPlaceSerializableService::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2.032

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 15
ccs 4
cts 5
cp 0.8
rs 10
cc 2
nc 2
nop 4
crap 2.032
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Ivory Google Map package.
7
 *
8
 * (c) Eric GELOEN <[email protected]>
9
 *
10
 * For the full copyright and license information, please read the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Ivory\GoogleMap\Service\Place;
15
16
use Ivory\GoogleMap\Service\AbstractSerializableService;
17
use Ivory\Serializer\SerializerInterface;
18
use Psr\Http\Client\ClientInterface as HttpClient;
19
use Psr\Http\Message\RequestFactoryInterface as MessageFactory;
20
21
abstract class AbstractPlaceSerializableService extends AbstractSerializableService
22
{
23 2
    public function __construct(
24
        HttpClient $client,
25
        MessageFactory $messageFactory,
26
        SerializerInterface $serializer = null,
27
        string $context = null
28
    ) {
29 2
        if (null !== $context) {
30
            $context = '/'.$context;
31
        }
32
33 2
        parent::__construct(
34 2
            'https://maps.googleapis.com/maps/api/place'.$context,
35
            $client,
36
            $messageFactory,
37
            $serializer
38
        );
39 2
    }
40
}
41