@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | $this->url = $this->argument('url'); |
69 | 69 | |
70 | - $this->limit = (int)$this->option('limit'); |
|
70 | + $this->limit = (int) $this->option('limit'); |
|
71 | 71 | |
72 | 72 | $this->parse(); |
73 | 73 | |
@@ -83,11 +83,11 @@ discard block |
||
83 | 83 | { |
84 | 84 | $firstPage = $this->download($this->url); |
85 | 85 | |
86 | - $allPages = (int)(new Crawler($firstPage))->filter('.uk-pagination > li')->last()->text(); |
|
86 | + $allPages = (int) (new Crawler($firstPage))->filter('.uk-pagination > li')->last()->text(); |
|
87 | 87 | |
88 | 88 | $name = (new Crawler($firstPage))->filterXpath('//meta[@name="geo.placename"]')->attr('content'); |
89 | 89 | |
90 | - $this->name = explode(', ', $name)[0]; |
|
90 | + $this->name = explode(', ', $name)[ 0 ]; |
|
91 | 91 | |
92 | 92 | $k = 0; |
93 | 93 | |
@@ -98,15 +98,15 @@ discard block |
||
98 | 98 | |
99 | 99 | $streets = (new Crawler($page))->filter('.c4 > a'); |
100 | 100 | |
101 | - $streets->each(function ($node) { |
|
101 | + $streets->each(function($node) { |
|
102 | 102 | $url = 'http://www.city-address.ru' . $node->attr('href'); |
103 | 103 | |
104 | 104 | $page = $this->download($url); |
105 | 105 | |
106 | 106 | $numbers = collect((new Crawler($page))->filter('.c6 > div > a')->extract('_text')) |
107 | - ->reject(function ($item) { |
|
107 | + ->reject(function($item) { |
|
108 | 108 | return strpos($item, 'дом ') !== 0; |
109 | - })->map(function ($item) { |
|
109 | + })->map(function($item) { |
|
110 | 110 | return str_replace('дом № ', '', $item); |
111 | 111 | })->toArray(); |
112 | 112 |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | |
133 | 133 | foreach ($cities as $city) { |
134 | 134 | if (!is_array($city)) { |
135 | - $city = [$city]; |
|
135 | + $city = [ $city ]; |
|
136 | 136 | } |
137 | 137 | foreach ($city as $item) { |
138 | 138 | $this->addCity($item); |
@@ -154,8 +154,8 @@ discard block |
||
154 | 154 | |
155 | 155 | $this->clearCities(); |
156 | 156 | |
157 | - if (sizeof($cities) === 1 && is_array($cities[0])) { |
|
158 | - $cities = $cities[0]; |
|
157 | + if (sizeof($cities) === 1 && is_array($cities[ 0 ])) { |
|
158 | + $cities = $cities[ 0 ]; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | $this->addCities($cities); |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | |
305 | 305 | foreach ($this->loadCities() as $key => $items) { |
306 | 306 | |
307 | - $this->availableCities->put($key, $items[0]); |
|
307 | + $this->availableCities->put($key, $items[ 0 ]); |
|
308 | 308 | |
309 | 309 | foreach ($items as $item) { |
310 | 310 | $item = $this->prepare($item); |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | */ |
325 | 325 | protected function prepare($string): string |
326 | 326 | { |
327 | - $string = str_replace([' ', '-', '_'], '', mb_strtolower($string)); |
|
327 | + $string = str_replace([ ' ', '-', '_' ], '', mb_strtolower($string)); |
|
328 | 328 | |
329 | 329 | return $string; |
330 | 330 | } |