@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | private function handleDepartments($departments) |
| 52 | 52 | { |
| 53 | - foreach($departments as $department){ |
|
| 53 | + foreach ($departments as $department) { |
|
| 54 | 54 | $key = key($department); |
| 55 | 55 | $department = last($department)['printouts']; |
| 56 | 56 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $iconUrlApi = str_replace(':file:', last($department['A une icone'])['fulltext'], $this->queryPictures); |
| 61 | 61 | |
| 62 | 62 | $characteristicModel = CharacteristicsModel::query()->where('code', $number)->first(); |
| 63 | - if(!isset($characteristicModel)){ |
|
| 63 | + if (!isset($characteristicModel)) { |
|
| 64 | 64 | $characteristicModel = new CharacteristicsModel(); |
| 65 | 65 | } |
| 66 | 66 | |
@@ -80,19 +80,19 @@ discard block |
||
| 80 | 80 | $response = $this->httpClient->get(config('wiki.api_uri').$iconUrlApi); |
| 81 | 81 | $content = json_decode($response->getBody()->getContents(), true); |
| 82 | 82 | $picturesInfo = $content['query']['pages']; |
| 83 | - foreach($picturesInfo as $picture) { |
|
| 83 | + foreach ($picturesInfo as $picture) { |
|
| 84 | 84 | if (isset($picture['imageinfo']) && isset(last($picture['imageinfo'])['url'])) { |
| 85 | 85 | $characteristicModel->page_id = $picture['pageid']; |
| 86 | 86 | try { |
| 87 | 87 | $response = $this->httpClient->get(last($picture['imageinfo'])['url']); |
| 88 | 88 | $content = $response->getBody()->getContents(); |
| 89 | - $path = 'public/characteristics/' . $uuid . '.png'; |
|
| 90 | - Storage::put('public/characteristics/' . $uuid . '.png', $content); |
|
| 91 | - }catch (ClientException $e){ |
|
| 89 | + $path = 'public/characteristics/'.$uuid.'.png'; |
|
| 90 | + Storage::put('public/characteristics/'.$uuid.'.png', $content); |
|
| 91 | + } catch (ClientException $e) { |
|
| 92 | 92 | $this->info('No icon for department : '.$number); |
| 93 | 93 | $path = ''; |
| 94 | 94 | } |
| 95 | - }else{ |
|
| 95 | + } else { |
|
| 96 | 96 | $this->info('No icon for department : '.$number); |
| 97 | 97 | $path = ''; |
| 98 | 98 | } |