StreetsDatabaseQuery   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 1
cbo 2
dl 0
loc 35
ccs 9
cts 9
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getStreets() 0 6 1
A addressLevel() 0 6 1
1
<?php
2
3
namespace GeoFixer\models\queries;
4
5
/**
6
 * Class StreetsDatabaseQuery
7
 *
8
 * @package GeoFixer\models\queries
9
 */
10
class StreetsDatabaseQuery extends AbstractDatabaseQuery
11
{
12
    /**
13
     * RegionsDatabaseQuery constructor.
14
     */
15 8
    public function __construct()
16
    {
17 8
        parent::__construct();
18 8
    }
19
20
    /**
21
     * Получаем улицы
22
     *
23
     * @return $this
24
     */
25 7
    public function getStreets()
26
    {
27 7
        $this->db = $this->db->select([self::FIAS_CODE, self::TITLE, self::KLADR_CODE])->from('fias_address_object');
28
29 7
        return $this;
30
    }
31
32
    /**
33
     * Address level равен улице
34
     *
35
     * @return $this
36
     */
37 7
    public function addressLevel()
38
    {
39 7
        $this->db = $this->db->andWhere(['address_level' => self::STREET]);
40
41 7
        return $this;
42
    }
43
44
}
45