@@ -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; |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | const MODEL_NAME = 'lien web'; |
| 20 | 20 | |
| 21 | 21 | const REQUIRED_PARAMETERS |
| 22 | - = [ |
|
| 22 | + = [ |
|
| 23 | 23 | // 'langue' => '', // suggéré |
| 24 | 24 | 'titre' => '', // required |
| 25 | 25 | 'url' => '', // required |
@@ -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 | } |
@@ -174,7 +174,7 @@ |
||
| 174 | 174 | new EditInfo($this->taskName, $this->minorFlag, $this->botFlag, $this->maxLag) |
| 175 | 175 | ); |
| 176 | 176 | dump($result); |
| 177 | - echo "Sleep ".(string)static::SLEEP_AFTER_EDITION."\n"; |
|
| 177 | + echo "Sleep ".(string) static::SLEEP_AFTER_EDITION."\n"; |
|
| 178 | 178 | sleep(static::SLEEP_AFTER_EDITION); |
| 179 | 179 | } |
| 180 | 180 | } |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $editInfo = new EditInfo(static::BOT_TALK_SUMMARY); |
| 59 | 59 | $success = $page->addToBottomOfThePage($addText, $editInfo); |
| 60 | 60 | |
| 61 | - return (bool)$success; |
|
| 61 | + return (bool) $success; |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /** |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | return null; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - return (string)trim($sentences[array_rand($sentences)]); |
|
| 89 | + return (string) trim($sentences[array_rand($sentences)]); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |