Completed
Push — master ( 74d8cf...88d0d9 )
by Marcin
02:58
created

Api::getCity()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * TERYT-API
4
 *
5
 * Copyright (c) 2017 pudelek.org.pl
6
 *
7
 * @license MIT License (MIT)
8
 *
9
 * For the full copyright and license information, please view source file
10
 * that is bundled with this package in the file LICENSE
11
 *
12
 * @author  Marcin Pudełek <[email protected]>
13
 *
14
 */
15
16
namespace mrcnpdlk\Teryt;
17
18
use mrcnpdlk\Teryt\Model\City;
19
20
21
/**
22
 * Class Api
23
 *
24
 * @package mrcnpdlk\Teryt
25
 */
26
class Api
27
{
28
    /**
29
     * @var NativeApi
30
     */
31
    private $oNativeApi;
32
33
    /**
34
     * Api constructor.
35
     *
36
     * @param Client $oClient
37
     */
38 2
    public function __construct(Client $oClient)
39
    {
40 2
        $this->oNativeApi = NativeApi::create($oClient);
41 2
    }
42
43
    /**
44
     * Get information about City
45
     *
46
     * @param string $id
47
     *
48
     * @return City
49
     */
50 2
    public function getCity(string $id)
51
    {
52 2
        $oCity = new City();
53
54 2
        return $oCity->find($id);
55
    }
56
57
}
58