@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | foreach ($cities as $city) { |
| 145 | 145 | if (!is_array($city)) { |
| 146 | - $city = [$city]; |
|
| 146 | + $city = [ $city ]; |
|
| 147 | 147 | } |
| 148 | 148 | foreach ($city as $item) { |
| 149 | 149 | $this->addCity($item); |
@@ -165,8 +165,8 @@ discard block |
||
| 165 | 165 | |
| 166 | 166 | $this->clearCities(); |
| 167 | 167 | |
| 168 | - if (sizeof($cities) === 1 && is_array($cities[0])) { |
|
| 169 | - $cities = $cities[0]; |
|
| 168 | + if (sizeof($cities) === 1 && is_array($cities[ 0 ])) { |
|
| 169 | + $cities = $cities[ 0 ]; |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | $this->addCities($cities); |
@@ -235,15 +235,15 @@ discard block |
||
| 235 | 235 | */ |
| 236 | 236 | public function loadCustomData(int $cityId, $cityName, string $dataFile): Generator |
| 237 | 237 | { |
| 238 | - $cityNames = is_array($cityName) ? $cityName : [$cityName]; |
|
| 238 | + $cityNames = is_array($cityName) ? $cityName : [ $cityName ]; |
|
| 239 | 239 | |
| 240 | - $data[$cityId] = $cityNames; |
|
| 240 | + $data[ $cityId ] = $cityNames; |
|
| 241 | 241 | |
| 242 | 242 | $this->makeCities($data); |
| 243 | 243 | |
| 244 | 244 | $this->customDataFiles->put($cityId, $dataFile); |
| 245 | 245 | |
| 246 | - $this->addCity($cityNames[0]); |
|
| 246 | + $this->addCity($cityNames[ 0 ]); |
|
| 247 | 247 | |
| 248 | 248 | return $this; |
| 249 | 249 | } |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | protected function loadData(int $cityId): array |
| 300 | 300 | { |
| 301 | 301 | $file = $this->customDataFiles->has($cityId) |
| 302 | - ? storage_path($this->customDataFiles->get($cityId) ) |
|
| 302 | + ? storage_path($this->customDataFiles->get($cityId)) |
|
| 303 | 303 | :__DIR__ . '/data/ru/' . $cityId . '.php'; |
| 304 | 304 | |
| 305 | 305 | if (!file_exists($file)) { |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | protected function makeCities($data) |
| 337 | 337 | { |
| 338 | 338 | foreach ($data as $key => $items) { |
| 339 | - $this->availableCities->put($key, $items[0]); |
|
| 339 | + $this->availableCities->put($key, $items[ 0 ]); |
|
| 340 | 340 | |
| 341 | 341 | foreach ($items as $item) { |
| 342 | 342 | $item = $this->prepare($item); |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | */ |
| 357 | 357 | protected function prepare($string): string |
| 358 | 358 | { |
| 359 | - $string = str_replace([' ', '-', '_'], '', mb_strtolower($string)); |
|
| 359 | + $string = str_replace([ ' ', '-', '_' ], '', mb_strtolower($string)); |
|
| 360 | 360 | |
| 361 | 361 | return $string; |
| 362 | 362 | } |