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

Api   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 29
ccs 6
cts 6
cp 1
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getCity() 0 5 1
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