@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | { |
25 | 25 | $httpClient = new Client(); |
26 | 26 | |
27 | - PageModel::query()->where('dry', true)->chunkById(50, function ($items, $count) use($httpClient){ |
|
27 | + PageModel::query()->where('dry', true)->chunkById(50, function($items, $count) use($httpClient){ |
|
28 | 28 | $this->info(($count*50).' Pages'); |
29 | 29 | $pages = $items->pluck('page_id')->toArray(); |
30 | 30 | $pagesApiUri = config('wiki.api_uri').$this->queryPages.implode('|', $pages); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $content = json_decode($response->getBody()->getContents(), true); |
33 | 33 | $wikiPages = $content['query']['pages']; |
34 | 34 | |
35 | - foreach($wikiPages as $page){ |
|
35 | + foreach ($wikiPages as $page) { |
|
36 | 36 | $pageModel = PageModel::query()->where('page_id', $page['pageid'])->first(); |
37 | 37 | |
38 | 38 | if (!isset($page['title'])) |
@@ -23,14 +23,14 @@ |
||
23 | 23 | |
24 | 24 | public function toDto():ContextDto |
25 | 25 | { |
26 | - $characteristics = $this->user->characteristics()->get()->transform(function(CharacteristicsModel $item){ |
|
26 | + $characteristics = $this->user->characteristics()->get()->transform(function(CharacteristicsModel $item) { |
|
27 | 27 | return $item->toDto(); |
28 | 28 | }); |
29 | 29 | |
30 | 30 | $numberDepartment = (new PostalCode($this->postal_code))->department(); |
31 | 31 | $characteristicDepartment = CharacteristicsModel::query()->where('code', $numberDepartment)->first(); |
32 | 32 | |
33 | - if(isset($characteristicDepartment)){ |
|
33 | + if (isset($characteristicDepartment)) { |
|
34 | 34 | $characteristics->push($characteristicDepartment->toDto()); |
35 | 35 | } |
36 | 36 |
@@ -18,11 +18,11 @@ discard block |
||
18 | 18 | ') |
19 | 19 | ->join('users', 'users.id', 'interactions.user_id') |
20 | 20 | ->join('contexts', 'users.context_id', 'contexts.id') |
21 | - ->when($type === 'follow', function ($query) { |
|
21 | + ->when($type === 'follow', function($query) { |
|
22 | 22 | $query->where('follow', true); |
23 | 23 | $query->orWhere('done', true); |
24 | 24 | }) |
25 | - ->when($type === 'do', function ($query) { |
|
25 | + ->when($type === 'do', function($query) { |
|
26 | 26 | $query->where('done', true); |
27 | 27 | }) |
28 | 28 | ->where('interactions.page_id', $pageId) |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | ->get(); |
32 | 32 | |
33 | 33 | $interactionsToReturn = []; |
34 | - foreach($interactions as $interaction){ |
|
34 | + foreach ($interactions as $interaction) { |
|
35 | 35 | $characteristicsModel = CharacteristicsModel::query()->where('code', $interaction->department)->first(); |
36 | 36 | $characteristicsModel->icon = route('api.icon.serve', ['id' => $characteristicsModel->uuid]); |
37 | 37 | $interaction->departmentData = $characteristicsModel; |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | ->join('contexts', 'users.context_id', 'contexts.id') |
52 | 52 | ->join('user_characteristics', 'user_characteristics.user_id', 'users.id') |
53 | 53 | ->join('characteristics', 'characteristics.id', 'user_characteristics.characteristic_id') |
54 | - ->when($type === 'follow', function ($query) { |
|
54 | + ->when($type === 'follow', function($query) { |
|
55 | 55 | $query->where('follow', true); |
56 | 56 | $query->orWhere('done', true); |
57 | 57 | }) |
58 | - ->when($type === 'do', function ($query) { |
|
58 | + ->when($type === 'do', function($query) { |
|
59 | 59 | $query->where('done', true); |
60 | 60 | }) |
61 | 61 | ->where('interactions.page_id', $pageId) |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | ->get(); |
68 | 68 | |
69 | 69 | $characteristicsToReturn = []; |
70 | - foreach($characteristicsCount as $characteristicCount){ |
|
70 | + foreach ($characteristicsCount as $characteristicCount) { |
|
71 | 71 | $characteristic = CharacteristicsModel::query()->find($characteristicCount->characteristic_id); |
72 | 72 | $characteristic->count = $characteristicCount->count; |
73 | 73 | $c = $characteristic->toArray(); |