Passed
Push — master ( 6be389...077fb2 )
by Dispositif
05:57
created
src/Domain/Utils/TemplateParser.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
             $result[$tplName][$inc] += ['model' => $tplObject];
70 70
         }
71 71
 
72
-        return (array)$result;
72
+        return (array) $result;
73 73
     }
74 74
 
75 75
     /**
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         ) {
189 189
             array_walk(
190 190
                 $matches,
191
-                function (&$value) {
191
+                function(&$value) {
192 192
                     $value = str_replace(['CURLYBRACKETO', 'CURLYBRACKETC'], ['{', '}'], $value);
193 193
                 }
194 194
             );
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
             }
249 249
             // No param name => take $keyNum as param name
250 250
             if (false === $pos) {
251
-                $param = (string)$keyNum;
251
+                $param = (string) $keyNum;
252 252
                 $value = $line;
253 253
                 ++$keyNum;
254 254
             }
Please login to merge, or discard this patch.
src/Domain/OuvrageOptimize.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
         if (count($res) >= 2 && empty($auteur2)) {
182 182
             // delete author-params
183 183
             array_map(
184
-                function ($param) {
184
+                function($param) {
185 185
                     $this->unsetParam($param);
186 186
                 },
187 187
                 ['auteur', 'auteurs', 'prénom1', 'nom1']
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
             // todo bug {{citation bloc}} si "=" ou "|" dans texte de citation
532 532
             // Legacy : use {{début citation}} ... {{fin citation}}
533 533
             if (preg_match('#[=|]#', $extrait) > 0) {
534
-                $this->optiTemplate->externalTemplates[] = (object)[
534
+                $this->optiTemplate->externalTemplates[] = (object) [
535 535
                     'template' => 'début citation',
536 536
                     '1' => '',
537 537
                     'raw' => '{{Début citation}}'.$extrait.'{{Fin citation}}',
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
                 $this->notCosmetic = true;
541 541
             } else {
542 542
                 // StdClass
543
-                $this->optiTemplate->externalTemplates[] = (object)[
543
+                $this->optiTemplate->externalTemplates[] = (object) [
544 544
                     'template' => 'citation bloc',
545 545
                     '1' => $extrait,
546 546
                     'raw' => '{{Citation bloc|'.$extrait.'}}',
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
         // "commentaire=bla" => {{Commentaire biblio|1=bla}}
557 557
         if ($this->hasParamValue('commentaire')) {
558 558
             $commentaire = $this->getParam('commentaire');
559
-            $this->optiTemplate->externalTemplates[] = (object)[
559
+            $this->optiTemplate->externalTemplates[] = (object) [
560 560
                 'template' => 'commentaire biblio',
561 561
                 '1' => $commentaire,
562 562
                 'raw' => '{{Commentaire biblio|'.$commentaire.'}}',
@@ -700,7 +700,7 @@  discard block
 block discarded – undo
700 700
             $this->log->error('Catch EDITOR_TITLES_FILENAME import '.$e->getMessage());
701 701
         }
702 702
         if (isset($data[$publisherName])) {
703
-            return (string)urldecode($data[$publisherName]);
703
+            return (string) urldecode($data[$publisherName]);
704 704
         }
705 705
 
706 706
         return null;
Please login to merge, or discard this patch.
src/Application/Examples/ouvrageCompleteProcess.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,9 +51,9 @@
 block discarded – undo
51 51
             sleep(60 * 10);
52 52
             exit;
53 53
         }
54
-        if(preg_match('#Quota exceeded#', $e->getMessage())) {
54
+        if (preg_match('#Quota exceeded#', $e->getMessage())) {
55 55
             echo "ouvrageCompleteProcess : Quota exceeded. Sleep 4h and EXIT.";
56
-            sleep(60*60*4);
56
+            sleep(60 * 60 * 4);
57 57
             exit;
58 58
         }
59 59
 
Please login to merge, or discard this patch.
src/Application/Http/HttpClientInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,5 +13,5 @@
 block discarded – undo
13 13
 
14 14
 interface HttpClientInterface
15 15
 {
16
-    public function getHTML(string $url, ?bool $normalized=false): ?string;
16
+    public function getHTML(string $url, ?bool $normalized = false): ?string;
17 17
 }
Please login to merge, or discard this patch.
src/Infrastructure/PageList.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
             }
59 59
         }
60 60
 
61
-        return new PageList((array)$titles);
61
+        return new PageList((array) $titles);
62 62
     }
63 63
 
64 64
     /**
Please login to merge, or discard this patch.
src/Application/OuvrageCompleteWorker.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@
 block discarded – undo
109 109
                         $row['id'],
110 110
                         $this->raw
111 111
                     )
112
-                );;
112
+                ); ;
113 113
                 $this->queueAdapter->skipRow(intval($row['id']));
114 114
                 sleep(10);
115 115
                 continue;
Please login to merge, or discard this patch.
src/Application/AbstractBotTaskWorker.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         $this->pastAnalyzed = ($analyzed !== false) ? $analyzed : [];
91 91
 
92 92
         // @throw exception on "Invalid CSRF token"
93
-        $this->run();//todo delete that and use (Worker)->run($duration) or process management
93
+        $this->run(); //todo delete that and use (Worker)->run($duration) or process management
94 94
     }
95 95
 
96 96
     protected function setUpInConstructor(): void
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
         }
267 267
 
268 268
         dump($result);
269
-        echo "Sleep ".(string)static::SLEEP_AFTER_EDITION."\n";
269
+        echo "Sleep ".(string) static::SLEEP_AFTER_EDITION."\n";
270 270
         sleep(static::SLEEP_AFTER_EDITION);
271 271
     }
272 272
 
Please login to merge, or discard this patch.
src/Domain/Publisher/ExternMapper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
                 $mapJson['DATA-TYPE'] = 'JSON-LD+META';
62 62
             }
63 63
             // récupère "accès url" de OpenGraph (prévaut sur JSON:'isAccessibleForFree'
64
-            if(isset($mapMeta['accès url']) ){
64
+            if (isset($mapMeta['accès url'])) {
65 65
                 $mapJson['accès url'] = $mapMeta['accès url'];
66 66
                 $mapJson['DATA-TYPE'] = 'JSON-LD+META';
67 67
             }
Please login to merge, or discard this patch.
src/Application/Examples/botstats.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -33,25 +33,25 @@  discard block
 block discarded – undo
33 33
 $data = [];
34 34
 
35 35
 $monitor = $db->fetchRow('select count(id) from page_ouvrages where optidate is null and edited is null and skip=0');
36
-$data['not analyzed citation'] = (int)$monitor['count(id)'];
36
+$data['not analyzed citation'] = (int) $monitor['count(id)'];
37 37
 
38 38
 $monitor = $db->fetchRow('select count(id) from page_ouvrages where optidate is not null');
39
-$data['analyzed citation'] = (int)$monitor['count(id)'];
39
+$data['analyzed citation'] = (int) $monitor['count(id)'];
40 40
 
41 41
 $monitor = $db->fetchRow('select count(distinct page) as n from page_ouvrages where skip=1 and edited is null'); //  ?
42
-$data['skip pages'] = (int)$monitor['n'];
42
+$data['skip pages'] = (int) $monitor['n'];
43 43
 
44 44
 $monitor = $db->fetchRow('select count(distinct page) as n from page_ouvrages where edited is true');
45
-$data['edited pages'] = (int)$monitor['n'];
45
+$data['edited pages'] = (int) $monitor['n'];
46 46
 
47 47
 $monitor = $db->fetchRow('select count(id) from page_ouvrages where optidate > SUBDATE(NOW(),1)');
48
-$data['analyzed citation 24H'] = (int)$monitor['count(id)'];
48
+$data['analyzed citation 24H'] = (int) $monitor['count(id)'];
49 49
 
50 50
 $monitor = $db->fetchRow('select count(id) as n from page_ouvrages where edited > SUBDATE(NOW(),1)');
51
-$data['edited citations 24H'] = (int)$monitor['n'];
51
+$data['edited citations 24H'] = (int) $monitor['n'];
52 52
 
53 53
 $monitor = $db->fetchRow('select count(distinct page) as n from page_ouvrages where edited > SUBDATE(NOW(),1)');
54
-$data['edited pages 24H'] = (int)$monitor['n'];
54
+$data['edited pages 24H'] = (int) $monitor['n'];
55 55
 
56 56
 $monitor = $db->fetchRow('SELECT count(distinct A.page) FROM page_ouvrages A
57 57
                 WHERE A.notcosmetic=1 AND A.opti IS NOT NULL
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
                         )
69 69
                     AND A.page = B.page
70 70
                     )');
71
-$data['waiting pages'] = (int)$monitor['count(distinct A.page)'];
71
+$data['waiting pages'] = (int) $monitor['count(distinct A.page)'];
72 72
 
73 73
 $data['currentdate'] = DateUtil::dateEnglish2french((new DateTime())->format('j F Y \à H\:i').' (CEST)');
74 74
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
 
80 80
 $monitWiki = '';
81
-if(!empty($monitor)) {
81
+if (!empty($monitor)) {
82 82
     foreach ($monitor as $monit) {
83 83
         // % = "%"
84 84
         $edited = new DateTime($monit['edited']);
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
             "<tr><td>%s &#37;</td><td>%s</td><td>[https://fr.wikipedia.org/w/index.php?title=%s&action=history histo]</td><td>[[%s]]</td><td>%s</td></tr>\n",
87 87
             $monit['altered'] ?? '?',
88 88
             $edited->format('d-m-Y'),
89
-            str_replace(' ','_', $monit['page']),
89
+            str_replace(' ', '_', $monit['page']),
90 90
             $monit['page'] ?? '??',
91 91
             $monit['version']
92 92
         );
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 wiki;
124 124
 
125 125
 $wikiText = str_replace('#monitor#', $monitWiki, $wikiText);
126
-foreach($data as $key => $dat){
126
+foreach ($data as $key => $dat) {
127 127
     $wikiText = str_replace('#'.$key.'#', $dat, $wikiText);
128 128
 }
129 129
 
Please login to merge, or discard this patch.