Passed
Branch master (66fada)
by Marcin
04:18 queued 16s
created

Catalog::PobierzKatalogULICAdr()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Importance

Changes 0
Metric Value
dl 7
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 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
/**
17
 * Created by Marcin.
18
 * Date: 10.09.2017
19
 * Time: 14:42
20
 */
21
22
namespace mrcnpdlk\Teryt\Api;
23
24
25
use mrcnpdlk\Teryt\Client;
26
use mrcnpdlk\Teryt\Helper;
27
28
class Catalog
29
{
30
    /**
31
     * Dane z systemu identyfikatorów TERC z wybranego stanu katalogu w wersji adresowej
32
     *
33
     * @return \SplFileObject
34
     */
35 View Code Duplication
    public static function PobierzKatalogTERCAdr(): \SplFileObject
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
36
    {
37
        $res     = Client::getInstance()->request('PobierzKatalogTERCAdr');
38
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
39
        $content = base64_decode($res->plik_zawartosc);
40
41
        return Helper::saveFile($sPath, $content);
42
    }
43
44
    /**
45
     * Dane z systemu identyfikatorów TERC z wybranego stanu katalogu w wersji urzędowej
46
     *
47
     * @return \SplFileObject
48
     */
49 View Code Duplication
    public static function PobierzKatalogTERC(): \SplFileObject
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
50
    {
51
        $res     = Client::getInstance()->request('PobierzKatalogTERC');
52
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
53
        $content = base64_decode($res->plik_zawartosc);
54
55
        return Helper::saveFile($sPath, $content);
56
    }
57
58
    /**
59
     * Identyfikatory i nazwy jednostek nomenklatury z wybranego stanu katalogu
60
     *
61
     * @return \SplFileObject
62
     */
63 View Code Duplication
    public static function PobierzKatalogNTS(): \SplFileObject
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
64
    {
65
        $res     = Client::getInstance()->request('PobierzKatalogNTS');
66
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
67
        $content = base64_decode($res->plik_zawartosc);
68
69
        return Helper::saveFile($sPath, $content);
70
    }
71
72
    /**
73
     * Dane o miejscowościach z systemu identyfikatorów SIMC z wybranego stanu katalogu w wersji adresowej
74
     *
75
     * @return \SplFileObject
76
     */
77 View Code Duplication
    public static function PobierzKatalogSIMCAdr(): \SplFileObject
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
78
    {
79
        $res     = Client::getInstance()->request('PobierzKatalogSIMCAdr');
80
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
81
        $content = base64_decode($res->plik_zawartosc);
82
83
        return Helper::saveFile($sPath, $content);
84
    }
85
86
    /**
87
     * Dane o miejscowościach z systemu identyfikatorów SIMC z wybranego stanu katalogu w wersji adresowej
88
     *
89
     * @return \SplFileObject
90
     */
91 View Code Duplication
    public static function PobierzKatalogSIMC(): \SplFileObject
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
92
    {
93
        $res     = Client::getInstance()->request('PobierzKatalogSIMC');
94
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
95
        $content = base64_decode($res->plik_zawartosc);
96
97
        return Helper::saveFile($sPath, $content);
98
    }
99
100
    /**
101
     * Dane o miejscowościach z systemu identyfikatorów SIMC z wybranego stanu katalogu w wersji adresowej
102
     *
103
     * @return \SplFileObject
104
     */
105 View Code Duplication
    public static function PobierzKatalogSIMCStat(): \SplFileObject
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
106
    {
107
        $res     = Client::getInstance()->request('PobierzKatalogSIMCStat');
108
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
109
        $content = base64_decode($res->plik_zawartosc);
110
111
        return Helper::saveFile($sPath, $content);
112
    }
113
114
    /**
115
     * Katalog ulic dla wskazanego stanu w wersji urzędowej
116
     *
117
     * @return \SplFileObject
118
     */
119 View Code Duplication
    public static function PobierzKatalogULIC(): \SplFileObject
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
120
    {
121
        $res     = Client::getInstance()->request('PobierzKatalogULIC');
122
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
123
        $content = base64_decode($res->plik_zawartosc);
124
125
        return Helper::saveFile($sPath, $content);
126
    }
127
128
    /**
129
     * Katalog ulic dla wskazanego stanu w wersji adresowej
130
     *
131
     * @return \SplFileObject
132
     */
133 View Code Duplication
    public static function PobierzKatalogULICAdr(): \SplFileObject
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
134
    {
135
        $res     = Client::getInstance()->request('PobierzKatalogULICAdr');
136
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
137
        $content = base64_decode($res->plik_zawartosc);
138
139
        return Helper::saveFile($sPath, $content);
140
    }
141
142
    /**
143
     * Katalog ulic dla wskazanego stanu w wersji urzędowej zmodyfikowany dla miast posiadający delegatury
144
     *
145
     * @return \SplFileObject
146
     */
147 View Code Duplication
    public static function PobierzKatalogULICBezDzielnic(): \SplFileObject
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
148
    {
149
        $res     = Client::getInstance()->request('PobierzKatalogULICBezDzielnic');
150
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
151
        $content = base64_decode($res->plik_zawartosc);
152
153
        return Helper::saveFile($sPath, $content);
154
    }
155
156
    /**
157
     * Katalog rodzajów miejscowości dla wskazanego stanu
158
     *
159
     * @return \SplFileObject
160
     */
161 View Code Duplication
    public static function PobierzKatalogWMRODZ(): \SplFileObject
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
162
    {
163
        $res     = Client::getInstance()->request('PobierzKatalogWMRODZ');
164
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
165
        $content = base64_decode($res->plik_zawartosc);
166
167
        return Helper::saveFile($sPath, $content);
168
    }
169
}
170