@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | } |
47 | 47 | $question = new ConfirmationQuestion('Update? ', false, '/^y/i'); |
48 | - $token = '?access_token=' . $fbToken; |
|
48 | + $token = '?access_token='.$fbToken; |
|
49 | 49 | |
50 | 50 | // Ids des différents groupes facebook |
51 | 51 | switch ($input->getArgument('promo')) { |
@@ -53,29 +53,29 @@ discard block |
||
53 | 53 | // pour avoir les étrangers |
54 | 54 | case '015': |
55 | 55 | $id = '359646667495742'; |
56 | - break; // Wei't spirit |
|
56 | + break; // Wei't spirit |
|
57 | 57 | case '016': |
58 | 58 | $id = '1451446761806184'; |
59 | 59 | break; // Wei't the phoque |
60 | 60 | case '017': |
61 | 61 | $id = '737969042997359'; |
62 | - break; // F'wei'ght Club |
|
62 | + break; // F'wei'ght Club |
|
63 | 63 | case '018': |
64 | 64 | $id = '1739424532975028'; |
65 | - break; // WEI'STED |
|
65 | + break; // WEI'STED |
|
66 | 66 | case '019': |
67 | 67 | $id = '313192685791329'; |
68 | - break; // WEI'T FOR IT |
|
68 | + break; // WEI'T FOR IT |
|
69 | 69 | case '020': |
70 | 70 | $id = '313192685791329'; |
71 | - break; // WEI'T FOR IT |
|
71 | + break; // WEI'T FOR IT |
|
72 | 72 | default: |
73 | 73 | return; |
74 | 74 | } |
75 | 75 | |
76 | 76 | // On récupère la liste des membres |
77 | 77 | $baseUrl = 'https://graph.facebook.com/v2.10'; |
78 | - $data = json_decode($curlService->curl($baseUrl . '/' . $id . '/members' . $token . '&limit=10000'), true); |
|
78 | + $data = json_decode($curlService->curl($baseUrl.'/'.$id.'/members'.$token.'&limit=10000'), true); |
|
79 | 79 | |
80 | 80 | $updateCount = 0; |
81 | 81 | $unfoundCount = 0; |
@@ -102,8 +102,8 @@ discard block |
||
102 | 102 | $output->writeln($user->getFirstName().' '.$user->getLastName().' <- '.$bestMatch['name'].' ('.$bestPercent.'% similar)'.($input->getOption('all') ? ' ['.($noPhoto ? 'to update' : 'already updated').']' : '')); |
103 | 103 | $updateConfirmation = $input->getOption('interactive') ? $questionHelper->ask($input, $output, $question) : true; |
104 | 104 | if (!$input->getOption('preview') && $updateConfirmation) { |
105 | - $url = '/' . $bestMatch['id'] . '/picture' . $token . '&width=9999&redirect=false'; |
|
106 | - $dataImage = json_decode($curlService->curl($baseUrl . $url), true); |
|
105 | + $url = '/'.$bestMatch['id'].'/picture'.$token.'&width=9999&redirect=false'; |
|
106 | + $dataImage = json_decode($curlService->curl($baseUrl.$url), true); |
|
107 | 107 | $image = $imageService->upload($dataImage['data']['url'], true); |
108 | 108 | $user->setImage($image); |
109 | 109 | } |
@@ -133,16 +133,16 @@ discard block |
||
133 | 133 | ]); |
134 | 134 | if ($input->getOption('all')) { |
135 | 135 | $output->writeln( |
136 | - [($input->getOption('preview') && !$input->getOption('interactive') ? 'To be i' : 'I').'mported missing photos: '.($updateCount-$updateExistingPhoto), |
|
137 | - 'Non-updated photos: '.($unfoundCount+$notUpdatedInteractivelyCount), |
|
136 | + [($input->getOption('preview') && !$input->getOption('interactive') ? 'To be i' : 'I').'mported missing photos: '.($updateCount - $updateExistingPhoto), |
|
137 | + 'Non-updated photos: '.($unfoundCount + $notUpdatedInteractivelyCount), |
|
138 | 138 | 'Replaced photos: '.$updateExistingPhoto |
139 | 139 | ]); |
140 | 140 | } |
141 | 141 | else { |
142 | 142 | $output->writeln( |
143 | - ['Missing photos in promo '.$userSpecification.': '.($updateCount+$unfoundCount+$notUpdatedInteractivelyCount), |
|
143 | + ['Missing photos in promo '.$userSpecification.': '.($updateCount + $unfoundCount + $notUpdatedInteractivelyCount), |
|
144 | 144 | ($input->getOption('preview') && !$input->getOption('interactive') ? 'To be i' : 'I').'mported missing photos: '.$updateCount, |
145 | - 'Remaining missing photos (unfound or refused Facebook profiles): '.($unfoundCount+$notUpdatedInteractivelyCount) |
|
145 | + 'Remaining missing photos (unfound or refused Facebook profiles): '.($unfoundCount + $notUpdatedInteractivelyCount) |
|
146 | 146 | ]); |
147 | 147 | } |
148 | 148 | } |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | private function isSimilar(User $user, array $member) |
153 | 153 | { |
154 | 154 | $percent = 0; |
155 | - similar_text($user->getFirstName() . ' ' . $user->getLastName(), $member['name'], $percent); |
|
155 | + similar_text($user->getFirstName().' '.$user->getLastName(), $member['name'], $percent); |
|
156 | 156 | return $percent; |
157 | 157 | } |
158 | 158 | } |
@@ -112,12 +112,10 @@ discard block |
||
112 | 112 | if (!$noPhoto) { |
113 | 113 | $updateExistingPhoto++; |
114 | 114 | } |
115 | - } |
|
116 | - else { |
|
115 | + } else { |
|
117 | 116 | $notUpdatedInteractivelyCount++; |
118 | 117 | } |
119 | - } |
|
120 | - else { |
|
118 | + } else { |
|
121 | 119 | $unfoundCount++; |
122 | 120 | } |
123 | 121 | |
@@ -137,8 +135,7 @@ discard block |
||
137 | 135 | 'Non-updated photos: '.($unfoundCount+$notUpdatedInteractivelyCount), |
138 | 136 | 'Replaced photos: '.$updateExistingPhoto |
139 | 137 | ]); |
140 | - } |
|
141 | - else { |
|
138 | + } else { |
|
142 | 139 | $output->writeln( |
143 | 140 | ['Missing photos in promo '.$userSpecification.': '.($updateCount+$unfoundCount+$notUpdatedInteractivelyCount), |
144 | 141 | ($input->getOption('preview') && !$input->getOption('interactive') ? 'To be i' : 'I').'mported missing photos: '.$updateCount, |
@@ -33,8 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | if ($input->getOption('all')) { |
35 | 35 | $clubsToUpdate = $userRepo->findAll(); |
36 | - } |
|
37 | - else { |
|
36 | + } else { |
|
38 | 37 | $clubsToUpdate = array_map([$userRepo, 'findOneBySlug'], $clubSlugs); |
39 | 38 | } |
40 | 39 | |
@@ -50,17 +49,14 @@ discard block |
||
50 | 49 | if ($countUsers == 0 && $clubToUpdate->getActive()) { |
51 | 50 | if ($input->getOption('preview')) { |
52 | 51 | $output->writeln('<comment>'.$clubToUpdate->getFullName().' to be disabled'.'</comment>'); |
53 | - } |
|
54 | - else { |
|
52 | + } else { |
|
55 | 53 | $clubToUpdate->setActive(false); |
56 | 54 | $output->writeln('<comment>'.$clubToUpdate->getFullName().' disabled'.'</comment>'); |
57 | 55 | } |
58 | - } |
|
59 | - else if ($countUsers > 0 && !$clubToUpdate->getActive()) { |
|
56 | + } else if ($countUsers > 0 && !$clubToUpdate->getActive()) { |
|
60 | 57 | if ($input->getOption('preview')) { |
61 | 58 | $output->writeln('<info>'.$clubToUpdate->getFullName().' to be enabled'.'</info>'); |
62 | - } |
|
63 | - else { |
|
59 | + } else { |
|
64 | 60 | $clubToUpdate->setActive(true); |
65 | 61 | $output->writeln('<info>'.$clubToUpdate->getFullName().' enabled'.'</info>'); |
66 | 62 | } |
@@ -52,7 +52,7 @@ |
||
52 | 52 | return $this->json([ |
53 | 53 | 'online' => $this->repository->getOnlineUsers($delay), |
54 | 54 | 'open' => $clubRepo->findOneBySlug('ki')->getOpen() |
55 | - ]); |
|
55 | + ]); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 |