@@ -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(); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | if (!$articleOrLienBrise instanceof ArticleOrLienBriseInterface) { |
50 | 50 | continue; |
51 | 51 | } |
52 | - if($articleOrLienBrise instanceof LienBriseTemplate){ |
|
52 | + if ($articleOrLienBrise instanceof LienBriseTemplate) { |
|
53 | 53 | $this->warning = true; |
54 | 54 | } |
55 | 55 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | public function hasWarning():bool |
64 | 64 | { |
65 | - return (bool)$this->warning; |
|
65 | + return (bool) $this->warning; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | private function replaceRefInText(array $ref, string $replace, string $text) |
@@ -69,13 +69,13 @@ |
||
69 | 69 | private $dataAnalysis; |
70 | 70 | |
71 | 71 | public function __construct(DbAdapter $dbAdapter, WikiBotConfig $bot, Memory $memory, RefGoogleBook $refGoogleBook, |
72 | - ?DataAnalysis $dataAnalysis=null) |
|
72 | + ?DataAnalysis $dataAnalysis = null) |
|
73 | 73 | { |
74 | 74 | $this->db = $dbAdapter; |
75 | 75 | $this->bot = $bot; |
76 | 76 | $this->memory = $memory; |
77 | 77 | $this->refGooConverter = $refGoogleBook; |
78 | - if($dataAnalysis) { |
|
78 | + if ($dataAnalysis) { |
|
79 | 79 | $this->dataAnalysis = $dataAnalysis; |
80 | 80 | } |
81 | 81 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | ) > 0 |
30 | 30 | ) { |
31 | 31 | // FIXED zizibot : des '<nowiki>' supplémentaires ajoutés à quelques rapports |
32 | - return str_replace('<nowiki>','', $matches[1]); |
|
32 | + return str_replace('<nowiki>', '', $matches[1]); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | return null; |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * |
56 | 56 | * @return string |
57 | 57 | */ |
58 | - public function deleteAllReports(string $text, ?string $botName='ZiziBotConfig'): string |
|
58 | + public function deleteAllReports(string $text, ?string $botName = 'ZiziBotConfig'): string |
|
59 | 59 | { |
60 | 60 | $pattern = sprintf( |
61 | 61 | '#== Ouvrage avec erreur de paramètre ==(.*)Le robot \[\[Utilisateur:%s\|%s\]\] \(\[\[Discussion utilisateur:%s\|discuter\]\]\) [0-9a-zéà: ]+ \(CET\)[\n]*#s', |
@@ -97,7 +97,7 @@ |
||
97 | 97 | if (!empty($articleData) && !empty($articleData['titre'])) { |
98 | 98 | $article = WikiTemplateFactory::create('article'); |
99 | 99 | $article->hydrate($articleData); |
100 | - if(!$article->hasParamValue('lire en ligne')) { |
|
100 | + if (!$article->hasParamValue('lire en ligne')) { |
|
101 | 101 | $article->setParam('lire en ligne', $this->url); |
102 | 102 | } |
103 | 103 | return $article; // ok |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | if (count($res) >= 2 && empty($auteur2)) { |
187 | 187 | // delete author-params |
188 | 188 | array_map( |
189 | - function ($param) { |
|
189 | + function($param) { |
|
190 | 190 | $this->unsetParam($param); |
191 | 191 | }, |
192 | 192 | ['auteur', 'auteurs', 'prénom1', 'nom1'] |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | if (!empty($goo) && $goo !== $url) { |
464 | 464 | $this->setParam($param, $goo); |
465 | 465 | // cleaned tracking parameters in Google URL ? |
466 | - if(GoogleLivresTemplate::isTrackingUrl($url)){ |
|
466 | + if (GoogleLivresTemplate::isTrackingUrl($url)) { |
|
467 | 467 | $this->log('tracking'); |
468 | 468 | $this->notCosmetic = true; |
469 | 469 | } |
@@ -726,7 +726,7 @@ discard block |
||
726 | 726 | // todo bug {{citation bloc}} si "=" ou "|" dans texte de citation |
727 | 727 | // Legacy : use {{début citation}} ... {{fin citation}} |
728 | 728 | if (preg_match('#[=|]#', $extrait) > 0) { |
729 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
729 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
730 | 730 | 'template' => 'début citation', |
731 | 731 | '1' => '', |
732 | 732 | 'raw' => '{{Début citation}}'.$extrait.'{{Fin citation}}', |
@@ -735,7 +735,7 @@ discard block |
||
735 | 735 | $this->notCosmetic = true; |
736 | 736 | } else { |
737 | 737 | // StdClass |
738 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
738 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
739 | 739 | 'template' => 'citation bloc', |
740 | 740 | '1' => $extrait, |
741 | 741 | 'raw' => '{{Citation bloc|'.$extrait.'}}', |
@@ -751,7 +751,7 @@ discard block |
||
751 | 751 | // "commentaire=bla" => {{Commentaire biblio|1=bla}} |
752 | 752 | if ($this->hasParamValue('commentaire')) { |
753 | 753 | $commentaire = $this->getParam('commentaire'); |
754 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
754 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
755 | 755 | 'template' => 'commentaire biblio', |
756 | 756 | '1' => $commentaire, |
757 | 757 | 'raw' => '{{Commentaire biblio|'.$commentaire.'}}', |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | const EXIT_ON_CHECK_WATCHPAGE = true; |
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, self::BLACKLIST_EDITOR)){ |
|
132 | + if (in_array($lastEditor, self::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 | } |
@@ -173,7 +173,7 @@ |
||
173 | 173 | new EditInfo($this->taskName, $this->minorFlag, $this->botFlag, 5) |
174 | 174 | ); |
175 | 175 | dump($result); |
176 | - echo "Sleep ".(string)static::SLEEP_AFTER_EDITION."\n"; |
|
176 | + echo "Sleep ".(string) static::SLEEP_AFTER_EDITION."\n"; |
|
177 | 177 | sleep(static::SLEEP_AFTER_EDITION); |
178 | 178 | } |
179 | 179 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $editInfo = new EditInfo(static::BOT_TALK_SUMMARY); |
63 | 63 | $success = $page->addToBottomOfThePage($addText, $editInfo); |
64 | 64 | |
65 | - return (bool)$success; |
|
65 | + return (bool) $success; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | private function generateTalkText(?string $toEditor = null, ?string $identation = ':') |
76 | 76 | { |
77 | - if($toEditor === 'Flow talk page manager'){ |
|
77 | + if ($toEditor === 'Flow talk page manager') { |
|
78 | 78 | $toEditor = null; |
79 | 79 | } |
80 | 80 | $to = ($toEditor) ? sprintf('@[[User:%s|%s]] : ', $toEditor, $toEditor) : ''; // {{notif}} |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | return null; |
128 | 128 | } |
129 | 129 | |
130 | - return (string)trim($sentences[array_rand($sentences)]); |
|
130 | + return (string) trim($sentences[array_rand($sentences)]); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |