@@ -7,7 +7,7 @@ |
||
7 | 7 | { |
8 | 8 | public static function prepare($string) |
9 | 9 | { |
10 | - $string = str_replace([' ', '-', '_'], '', mb_strtolower($string)); |
|
10 | + $string = str_replace([ ' ', '-', '_' ], '', mb_strtolower($string)); |
|
11 | 11 | |
12 | 12 | return $string; |
13 | 13 | } |
@@ -5,8 +5,8 @@ |
||
5 | 5 | */ |
6 | 6 | |
7 | 7 | return [ |
8 | - 'Красный проспект' => [73, 75, 72, 74, 76, ], |
|
9 | - 'Писарева' => [20, 42, 53, '89а', '40/1', ], |
|
10 | - 'Гоголя' => [17, 19, 21, 4, 14, ], |
|
11 | - 'Советская' => [30, '36/1', '17а', ], |
|
8 | + 'Красный проспект' => [ 73, 75, 72, 74, 76, ], |
|
9 | + 'Писарева' => [ 20, 42, 53, '89а', '40/1', ], |
|
10 | + 'Гоголя' => [ 17, 19, 21, 4, 14, ], |
|
11 | + 'Советская' => [ 30, '36/1', '17а', ], |
|
12 | 12 | ]; |
13 | 13 | \ No newline at end of file |
@@ -5,6 +5,6 @@ |
||
5 | 5 | */ |
6 | 6 | |
7 | 7 | return [ |
8 | - 'Партизана Железняка' => [14, 16, 7, 5], |
|
9 | - 'Взлётная' => [24, '24а', 18, 10, 2], |
|
8 | + 'Партизана Железняка' => [ 14, 16, 7, 5 ], |
|
9 | + 'Взлётная' => [ 24, '24а', 18, 10, 2 ], |
|
10 | 10 | ]; |
11 | 11 | \ No newline at end of file |
@@ -5,6 +5,6 @@ |
||
5 | 5 | */ |
6 | 6 | |
7 | 7 | return [ |
8 | - 'Вокзальная' => [25, 27, 43, 54, ], |
|
9 | - 'Железнодорожная' => [3, 5, 7, 30, ], |
|
8 | + 'Вокзальная' => [ 25, 27, 43, 54, ], |
|
9 | + 'Железнодорожная' => [ 3, 5, 7, 30, ], |
|
10 | 10 | ]; |
11 | 11 | \ No newline at end of file |
@@ -5,6 +5,6 @@ |
||
5 | 5 | */ |
6 | 6 | |
7 | 7 | return [ |
8 | - 'Малахова' => [75, 73, 85], |
|
9 | - 'Антона Петрова' => [136, 124, 116, ], |
|
8 | + 'Малахова' => [ 75, 73, 85 ], |
|
9 | + 'Антона Петрова' => [ 136, 124, 116, ], |
|
10 | 10 | ]; |
11 | 11 | \ No newline at end of file |
@@ -5,6 +5,6 @@ |
||
5 | 5 | */ |
6 | 6 | |
7 | 7 | return [ |
8 | - '10 лет Октября' => [147, 175, 187, ], |
|
9 | - '20 лет РККА' => [11, 13, '10/2', ], |
|
8 | + '10 лет Октября' => [ 147, 175, 187, ], |
|
9 | + '20 лет РККА' => [ 11, 13, '10/2', ], |
|
10 | 10 | ]; |
11 | 11 | \ No newline at end of file |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | { |
89 | 89 | foreach ($cities as $city) { |
90 | 90 | if (!is_array($city)) { |
91 | - $city = [$city]; |
|
91 | + $city = [ $city ]; |
|
92 | 92 | } |
93 | 93 | foreach ($city as $item) { |
94 | 94 | $this->addCity($item); |
@@ -108,8 +108,8 @@ discard block |
||
108 | 108 | { |
109 | 109 | $this->clearCities(); |
110 | 110 | |
111 | - if (sizeof($cities) === 1 && is_array($cities[0])) { |
|
112 | - $cities = $cities[0]; |
|
111 | + if (sizeof($cities) === 1 && is_array($cities[ 0 ])) { |
|
112 | + $cities = $cities[ 0 ]; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | $this->addCities($cities); |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | |
203 | 203 | foreach (include('data/cities.php') as $key => $items) { |
204 | 204 | |
205 | - $this->availableCities->put($key, $items[0]); |
|
205 | + $this->availableCities->put($key, $items[ 0 ]); |
|
206 | 206 | |
207 | 207 | foreach ($items as $item) { |
208 | 208 | $item = Helper::prepare($item); |
@@ -46,14 +46,14 @@ discard block |
||
46 | 46 | |
47 | 47 | $url = $this->argument('url'); |
48 | 48 | |
49 | - $limit = (int)$this->option('limit'); |
|
49 | + $limit = (int) $this->option('limit'); |
|
50 | 50 | |
51 | 51 | /** |
52 | 52 | * Получаем список всех страниц с улицами |
53 | 53 | */ |
54 | 54 | $firstPage = $this->download($url); |
55 | 55 | |
56 | - $allPages = (int)(new Crawler($firstPage))->filter('.uk-pagination > li')->last()->text(); |
|
56 | + $allPages = (int) (new Crawler($firstPage))->filter('.uk-pagination > li')->last()->text(); |
|
57 | 57 | |
58 | 58 | $k = 0; |
59 | 59 | for ($i = 1; $i <= $allPages; $i++) { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | $streets = (new Crawler($page))->filter('.c4 > a'); |
68 | 68 | |
69 | - $streets->each(function ($node) { |
|
69 | + $streets->each(function($node) { |
|
70 | 70 | /** |
71 | 71 | * Получаем список домов |
72 | 72 | */ |
@@ -78,9 +78,9 @@ discard block |
||
78 | 78 | * Обрабатываем список домов |
79 | 79 | */ |
80 | 80 | $numbers = collect((new Crawler($page))->filter('.c6 > div > a')->extract('_text')) |
81 | - ->reject(function ($item, $key) { |
|
81 | + ->reject(function($item, $key) { |
|
82 | 82 | return strpos($item, 'дом ') !== 0; |
83 | - })->map(function ($item, $key) { |
|
83 | + })->map(function($item, $key) { |
|
84 | 84 | return str_replace('дом № ', '', $item); |
85 | 85 | })->toArray(); |
86 | 86 |