@@ -111,7 +111,7 @@ |
||
111 | 111 | { |
112 | 112 | // Style "auto1234" |
113 | 113 | if (empty($this->getParam('périodique') || empty($this->getParam('date')))) { |
114 | - return 'auto'.(string)rand(1000, 9999); |
|
114 | + return 'auto'.(string) rand(1000, 9999); |
|
115 | 115 | } |
116 | 116 | // Style "LeMonde15022017" |
117 | 117 | $periodique = str_replace( |
@@ -52,7 +52,7 @@ |
||
52 | 52 | { |
53 | 53 | $data = $this->getFileData(); |
54 | 54 | $this->lastDate = new DateTime($data['date'], new DateTimeZone(static::REBOOT_TIMEZONE)); |
55 | - $this->count = (int)$data['count']; |
|
55 | + $this->count = (int) $data['count']; |
|
56 | 56 | |
57 | 57 | // Today reboot date/time of the quota |
58 | 58 | $todayBoot = new DateTime(); |
@@ -258,10 +258,10 @@ |
||
258 | 258 | unset($dat['dq']); |
259 | 259 | } |
260 | 260 | } |
261 | - if(empty($dat['q'])) { |
|
261 | + if (empty($dat['q'])) { |
|
262 | 262 | unset($dat['q']); |
263 | 263 | } |
264 | - if(empty($dat['dq'])) { |
|
264 | + if (empty($dat['dq'])) { |
|
265 | 265 | unset($dat['dq']); |
266 | 266 | } |
267 | 267 |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | { |
145 | 145 | // todo verify/useless ? |
146 | 146 | if (is_int($name)) { |
147 | - $name = (string)$name; |
|
147 | + $name = (string) $name; |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | // that parameter exists in template ? |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | } catch (Throwable $e) { |
268 | 268 | unset($e); |
269 | 269 | // hack : 1 => "ouvrage collectif" |
270 | - $name = (string)$name; |
|
270 | + $name = (string) $name; |
|
271 | 271 | $this->log[] = "parameter $name not found"; |
272 | 272 | if (!$noError) { |
273 | 273 | $this->parametersErrorFromHydrate[$name] = $value; |
@@ -107,7 +107,7 @@ |
||
107 | 107 | ['[[wikilien]', 'wikilien'], |
108 | 108 | ['[[wiki|wikilien]]', 'wikilien'], |
109 | 109 | ['{{en}}', '{{en}}'], |
110 | - ['{{Lien|Jeffrey Robinson}}','Jeffrey Robinson'], |
|
110 | + ['{{Lien|Jeffrey Robinson}}', 'Jeffrey Robinson'], |
|
111 | 111 | ]; |
112 | 112 | } |
113 | 113 | } |
@@ -39,7 +39,7 @@ |
||
39 | 39 | { |
40 | 40 | return array_filter( |
41 | 41 | $myArray, |
42 | - function ($value) { |
|
42 | + function($value) { |
|
43 | 43 | return (null !== $value && '' !== $value); |
44 | 44 | } |
45 | 45 | ); |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | } |
107 | 107 | |
108 | 108 | // translation : "London"->"Londres" seulement si langue=fr |
109 | - if($this->hasParamValue('langue') |
|
110 | - && $this->getParam('langue') === self::WIKI_LANGUAGE ) { |
|
109 | + if ($this->hasParamValue('langue') |
|
110 | + && $this->getParam('langue') === self::WIKI_LANGUAGE) { |
|
111 | 111 | $manager = new FileManager(); |
112 | 112 | $row = $manager->findCSVline(__DIR__.'/resources/traduction_ville.csv', $location); |
113 | 113 | if (!empty($row) && !empty($row[1])) { |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | if (count($res) >= 2 && empty($auteur2)) { |
193 | 193 | // delete author-params |
194 | 194 | array_map( |
195 | - function ($param) { |
|
195 | + function($param) { |
|
196 | 196 | $this->unsetParam($param); |
197 | 197 | }, |
198 | 198 | ['auteur', 'auteurs', 'prénom1', 'nom1'] |
@@ -732,7 +732,7 @@ discard block |
||
732 | 732 | // todo bug {{citation bloc}} si "=" ou "|" dans texte de citation |
733 | 733 | // Legacy : use {{début citation}} ... {{fin citation}} |
734 | 734 | if (preg_match('#[=|]#', $extrait) > 0) { |
735 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
735 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
736 | 736 | 'template' => 'début citation', |
737 | 737 | '1' => '', |
738 | 738 | 'raw' => '{{Début citation}}'.$extrait.'{{Fin citation}}', |
@@ -741,7 +741,7 @@ discard block |
||
741 | 741 | $this->notCosmetic = true; |
742 | 742 | } else { |
743 | 743 | // StdClass |
744 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
744 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
745 | 745 | 'template' => 'citation bloc', |
746 | 746 | '1' => $extrait, |
747 | 747 | 'raw' => '{{Citation bloc|'.$extrait.'}}', |
@@ -757,7 +757,7 @@ discard block |
||
757 | 757 | // "commentaire=bla" => {{Commentaire biblio|1=bla}} |
758 | 758 | if ($this->hasParamValue('commentaire')) { |
759 | 759 | $commentaire = $this->getParam('commentaire'); |
760 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
760 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
761 | 761 | 'template' => 'commentaire biblio', |
762 | 762 | '1' => $commentaire, |
763 | 763 | 'raw' => '{{Commentaire biblio|'.$commentaire.'}}', |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | const EXIT_ON_CHECK_WATCHPAGE = false; |
31 | 31 | |
32 | 32 | // do not stop if they play with {stop} on bot talk page |
33 | - const BLACKLIST_EDITOR = ['NB80']; |
|
33 | + const BLACKLIST_EDITOR = ['NB80']; |
|
34 | 34 | |
35 | 35 | const BOT_FLAG = false; |
36 | 36 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | "\n*** STOP ON TALK PAGE BY %s ***\n\n", |
130 | 130 | $lastEditor |
131 | 131 | ); |
132 | - if(in_array($lastEditor, static::BLACKLIST_EDITOR)){ |
|
132 | + if (in_array($lastEditor, static::BLACKLIST_EDITOR)) { |
|
133 | 133 | return; |
134 | 134 | } |
135 | 135 | |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | */ |
222 | 222 | public function minutesSinceLastEdit(string $title): int |
223 | 223 | { |
224 | - $time = $this->getTimestamp($title); // 2011-09-02T16:31:13Z |
|
224 | + $time = $this->getTimestamp($title); // 2011-09-02T16:31:13Z |
|
225 | 225 | |
226 | 226 | return (int) round((time() - strtotime($time)) / 60); |
227 | 227 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | public function __construct(QueueInterface $queueAdapter, ?bool $verbose = false) |
61 | 61 | { |
62 | 62 | $this->queueAdapter = $queueAdapter; |
63 | - $this->verbose = (bool)$verbose; |
|
63 | + $this->verbose = (bool) $verbose; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | public function run(?int $limit = 10000) |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | $this->completeOuvrage($googleOuvrage); |
229 | 229 | } catch (Throwable $e) { |
230 | 230 | echo "*** ERREUR GOOGLE Isbn Search ***".$e->getMessage()."\n"; |
231 | - if( strpos($e->getMessage(), 'Could not resolve host: www.googleapis.com') === false) { |
|
231 | + if (strpos($e->getMessage(), 'Could not resolve host: www.googleapis.com') === false) { |
|
232 | 232 | throw $e; |
233 | 233 | } |
234 | 234 | unset($e); |