@@ -22,7 +22,7 @@ |
||
22 | 22 | { |
23 | 23 | public function process($data): array |
24 | 24 | { |
25 | - if(!isset($data['JSON-LD'])) { |
|
25 | + if (!isset($data['JSON-LD'])) { |
|
26 | 26 | return []; |
27 | 27 | } |
28 | 28 | $data = $data['JSON-LD']; |
@@ -21,7 +21,7 @@ |
||
21 | 21 | { |
22 | 22 | public function process($data): array |
23 | 23 | { |
24 | - if(!isset($data['JSON-LD'])) { |
|
24 | + if (!isset($data['JSON-LD'])) { |
|
25 | 25 | return []; |
26 | 26 | } |
27 | 27 | $ld = $data['JSON-LD']; |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | /** |
53 | 53 | * @var AbstractWikiTemplate |
54 | 54 | */ |
55 | - try{ |
|
55 | + try { |
|
56 | 56 | $tplObject = WikiTemplateFactory::create($tplName); |
57 | - }catch (\Throwable $e){ |
|
57 | + } catch (\Throwable $e) { |
|
58 | 58 | unset($e); |
59 | 59 | continue; |
60 | 60 | } |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | ) { |
190 | 190 | array_walk( |
191 | 191 | $matches, |
192 | - function (&$value) { |
|
192 | + function(&$value) { |
|
193 | 193 | $value = str_replace(['CURLYBRACKETO', 'CURLYBRACKETC'], ['{', '}'], $value); |
194 | 194 | } |
195 | 195 | ); |
@@ -54,7 +54,7 @@ |
||
54 | 54 | */ |
55 | 55 | try{ |
56 | 56 | $tplObject = WikiTemplateFactory::create($tplName); |
57 | - }catch (\Throwable $e){ |
|
57 | + } catch (\Throwable $e){ |
|
58 | 58 | unset($e); |
59 | 59 | continue; |
60 | 60 | } |
@@ -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) |
@@ -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'] |
@@ -723,7 +723,7 @@ discard block |
||
723 | 723 | // todo bug {{citation bloc}} si "=" ou "|" dans texte de citation |
724 | 724 | // Legacy : use {{début citation}} ... {{fin citation}} |
725 | 725 | if (preg_match('#[=|]#', $extrait) > 0) { |
726 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
726 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
727 | 727 | 'template' => 'début citation', |
728 | 728 | '1' => '', |
729 | 729 | 'raw' => '{{Début citation}}'.$extrait.'{{Fin citation}}', |
@@ -732,7 +732,7 @@ discard block |
||
732 | 732 | $this->notCosmetic = true; |
733 | 733 | } else { |
734 | 734 | // StdClass |
735 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
735 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
736 | 736 | 'template' => 'citation bloc', |
737 | 737 | '1' => $extrait, |
738 | 738 | 'raw' => '{{Citation bloc|'.$extrait.'}}', |
@@ -748,7 +748,7 @@ discard block |
||
748 | 748 | // "commentaire=bla" => {{Commentaire biblio|1=bla}} |
749 | 749 | if ($this->hasParamValue('commentaire')) { |
750 | 750 | $commentaire = $this->getParam('commentaire'); |
751 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
751 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
752 | 752 | 'template' => 'commentaire biblio', |
753 | 753 | '1' => $commentaire, |
754 | 754 | 'raw' => '{{Commentaire biblio|'.$commentaire.'}}', |
@@ -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 |
@@ -221,7 +221,7 @@ |
||
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 | } |
@@ -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 | /** |