Passed
Push — feature/v4 ( 69e935...62277d )
by Samuel
05:01
created

AbstractPlaceSerializableService::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2.0078

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 15
ccs 7
cts 8
cp 0.875
rs 10
cc 2
nc 2
nop 4
crap 2.0078
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 2
            $client,
36 2
            $messageFactory,
37 2
            $serializer
38
        );
39 2
    }
40
}
41