@@ -19,7 +19,7 @@ |
||
19 | 19 | { |
20 | 20 | $practisesToReturn = []; |
21 | 21 | $practises = $this->interactionsRepository->getDoneByUser($userId); |
22 | - foreach ($practises as $practise){ |
|
22 | + foreach ($practises as $practise) { |
|
23 | 23 | $year = $practise->doneAt() !== null ? $practise->doneAt()->format('Y') : 'Non datée'; |
24 | 24 | $practisesToReturn[$year][] = $practise->toArray(); |
25 | 25 | } |
@@ -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'])) |
@@ -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 | $interaction->departmentData = $characteristicsModel; |
37 | 37 | $interactionsToReturn[] = $interaction->toArray(); |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | ->join('contexts', 'users.context_id', 'contexts.id') |
51 | 51 | ->join('user_characteristics', 'user_characteristics.user_id', 'users.id') |
52 | 52 | ->join('characteristics', 'characteristics.id', 'user_characteristics.characteristic_id') |
53 | - ->when($type === 'follow', function ($query) { |
|
53 | + ->when($type === 'follow', function($query) { |
|
54 | 54 | $query->where('follow', true); |
55 | 55 | $query->orWhere('done', true); |
56 | 56 | }) |
57 | - ->when($type === 'do', function ($query) { |
|
57 | + ->when($type === 'do', function($query) { |
|
58 | 58 | $query->where('done', true); |
59 | 59 | }) |
60 | 60 | ->where('interactions.page_id', $pageId) |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | ->get(); |
67 | 67 | |
68 | 68 | $characteristicsToReturn = []; |
69 | - foreach($characteristicsCount as $characteristicCount){ |
|
69 | + foreach ($characteristicsCount as $characteristicCount) { |
|
70 | 70 | $characteristic = CharacteristicsModel::query()->find($characteristicCount->characteristic_id); |
71 | 71 | $characteristic->count = $characteristicCount->count; |
72 | 72 | $characteristicsToReturn[] = $characteristic->toArray(); |