Completed
Push — master ( d676b1...ecc147 )
by Dispositif
02:12
created
src/Application/Examples/botstats.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -32,25 +32,25 @@  discard block
 block discarded – undo
32 32
 $data = [];
33 33
 
34 34
 $monitor = $db->fetchRow('select count(id) from temprawopti where optidate is null and edited is null');
35
-$data['not analyzed citation'] = (int)$monitor['count(id)'];
35
+$data['not analyzed citation'] = (int) $monitor['count(id)'];
36 36
 
37 37
 $monitor = $db->fetchRow('select count(id) from temprawopti where optidate is not null');
38
-$data['analyzed citation'] = (int)$monitor['count(id)'];
38
+$data['analyzed citation'] = (int) $monitor['count(id)'];
39 39
 
40 40
 $monitor = $db->fetchRow('select count(distinct page) as n from temprawopti where skip=1 and edited is null');
41
-$data['skip pages'] = (int)$monitor['n'];
41
+$data['skip pages'] = (int) $monitor['n'];
42 42
 
43 43
 $monitor = $db->fetchRow('select count(distinct page) as n from temprawopti where edited is true');
44
-$data['edited pages'] = (int)$monitor['n'];
44
+$data['edited pages'] = (int) $monitor['n'];
45 45
 
46 46
 $monitor = $db->fetchRow('select count(id) from temprawopti where optidate > SUBDATE(NOW(),1)');
47
-$data['analyzed citation 24H'] = (int)$monitor['count(id)'];
47
+$data['analyzed citation 24H'] = (int) $monitor['count(id)'];
48 48
 
49 49
 $monitor = $db->fetchRow('select count(id) as n from temprawopti where edited > SUBDATE(NOW(),1)');
50
-$data['edited citations 24H'] = (int)$monitor['n'];
50
+$data['edited citations 24H'] = (int) $monitor['n'];
51 51
 
52 52
 $monitor = $db->fetchRow('select count(distinct page) as n from temprawopti where edited > SUBDATE(NOW(),1)');
53
-$data['edited pages 24H'] = (int)$monitor['n'];
53
+$data['edited pages 24H'] = (int) $monitor['n'];
54 54
 
55 55
 $monitor = $db->fetchRow('SELECT count(distinct A.page) FROM TempRawOpti A
56 56
                 WHERE notcosmetic=1.
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
                         )
66 66
                     AND A.page = B.page
67 67
                     )');
68
-$data['waiting pages'] = (int)$monitor['count(distinct A.page)'];
68
+$data['waiting pages'] = (int) $monitor['count(distinct A.page)'];
69 69
 
70 70
 $data['currentdate'] = DateUtil::dateEnglish2french((new DateTime())->format('j F Y \à H\:i').' (CEST)');
71 71
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
 
77 77
 $monitWiki = '';
78
-if(!empty($monitor)) {
78
+if (!empty($monitor)) {
79 79
     foreach ($monitor as $monit) {
80 80
         // % = "%"
81 81
         $edited = new DateTime($monit['edited']);
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
             "<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",
84 84
             $monit['altered'] ?? '?',
85 85
             $edited->format('d-m-Y'),
86
-            str_replace(' ','_', $monit['page']),
86
+            str_replace(' ', '_', $monit['page']),
87 87
             $monit['page'] ?? '??',
88 88
             $monit['version']
89 89
         );
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 wiki;
123 123
 
124 124
 $wikiText = str_replace('#monitor#', $monitWiki, $wikiText);
125
-foreach($data as $key => $dat){
125
+foreach ($data as $key => $dat) {
126 126
     $wikiText = str_replace('#'.$key.'#', $dat, $wikiText);
127 127
 }
128 128
 
Please login to merge, or discard this patch.
src/Domain/OuvrageOptimize.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
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']
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
             // todo bug {{citation bloc}} si "=" ou "|" dans texte de citation
697 697
             // Legacy : use {{début citation}} ... {{fin citation}}
698 698
             if (preg_match('#[=|]#', $extrait) > 0) {
699
-                $this->ouvrage->externalTemplates[] = (object)[
699
+                $this->ouvrage->externalTemplates[] = (object) [
700 700
                     'template' => 'début citation',
701 701
                     '1' => '',
702 702
                     'raw' => '{{Début citation}}'.$extrait.'{{Fin citation}}',
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
                 $this->notCosmetic = true;
706 706
             } else {
707 707
                 // StdClass
708
-                $this->ouvrage->externalTemplates[] = (object)[
708
+                $this->ouvrage->externalTemplates[] = (object) [
709 709
                     'template' => 'citation bloc',
710 710
                     '1' => $extrait,
711 711
                     'raw' => '{{Citation bloc|'.$extrait.'}}',
@@ -721,7 +721,7 @@  discard block
 block discarded – undo
721 721
         // "commentaire=bla" => {{Commentaire biblio|1=bla}}
722 722
         if (!empty($this->getParam('commentaire'))) {
723 723
             $commentaire = $this->getParam('commentaire');
724
-            $this->ouvrage->externalTemplates[] = (object)[
724
+            $this->ouvrage->externalTemplates[] = (object) [
725 725
                 'template' => 'commentaire biblio',
726 726
                 '1' => $commentaire,
727 727
                 'raw' => '{{Commentaire biblio|'.$commentaire.'}}',
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 //    {
130 130
 //        $value = $this->getParam($param);
131 131
 //        // note : strval() condition because intval('4c') = 4
132
-          // opti : $number can also be of type double
132
+            // opti : $number can also be of type double
133 133
 //        if ($value && intval($value) > 0 && intval($value) <= 10 && strval(intval($value)) === $value) {
134 134
 //            $number = abs(intval($value));
135 135
 //            $roman = NumberUtil::arab2roman($number);
@@ -473,8 +473,8 @@  discard block
 block discarded – undo
473 473
                 $this->log('°titre');
474 474
             }
475 475
 
476
-             // desactivé à cause de l'exception décrite ci-dessus
477
-             // si langue=VIDE : ajout langue= à partir de langue titre
476
+                // desactivé à cause de l'exception décrite ci-dessus
477
+                // si langue=VIDE : ajout langue= à partir de langue titre
478 478
 //            if (self::WIKI_LANGUAGE !== $lang && empty($this->getParam('langue'))) {
479 479
 //                $this->setParam('langue', $lang);
480 480
 //                $this->log('+langue='.$lang);
Please login to merge, or discard this patch.
src/Application/ErrorReport.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
55 55
      *
56 56
      * @return string
57 57
      */
58
-    public function deleteAllReports(string $text, ?string $botName='ZiziBot'): string
58
+    public function deleteAllReports(string $text, ?string $botName = 'ZiziBot'): 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',
Please login to merge, or discard this patch.
src/Application/Examples/EditProcess.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -305,7 +305,7 @@
 block discarded – undo
305 305
             '%s [%s/%s] %s %s : %s',
306 306
             $prefix,
307 307
             str_replace('v', '', $this->bot::getGitVersion()),
308
-            str_replace(['v0.','v1.'], '', $this->citationVersion),
308
+            str_replace(['v0.', 'v1.'], '', $this->citationVersion),
309 309
             self::TASK_NAME,
310 310
             $this->nbRows,
311 311
             $citeSummary
Please login to merge, or discard this patch.
src/Domain/Utils/ArrayProcessTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
     {
23 23
         return array_filter(
24 24
             $myArray,
25
-            function ($value) {
25
+            function($value) {
26 26
                 return !is_null($value) && '' !== $value;
27 27
             }
28 28
         );
Please login to merge, or discard this patch.
src/Domain/Publisher/GoogleBookMapper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
             'titre' => $volume->title,
43 43
             'sous-titre' => $this->filterSubtitle($volume),
44 44
             'année' => $this->convertDate2Year($volume->publishedDate),
45
-            'pages totales' => (string)$volume->pageCount ?? null,
45
+            'pages totales' => (string) $volume->pageCount ?? null,
46 46
             'isbn' => $this->convertIsbn($volume),
47 47
             //            'présentation en ligne' => $this->presentationEnLigne($volume),
48 48
             'lire en ligne' => $this->lireEnLigne($volume),
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             return null;
80 80
         }
81 81
         if (preg_match('/[^0-9]?([12][0-9]{3})[^0-9]?/', $data, $matches) > 0) {
82
-            return (string)$matches[1];
82
+            return (string) $matches[1];
83 83
         }
84 84
 
85 85
         return null;
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         // so isbn-13 replace isbn-10
99 99
         // todo refac algo (if 2x isbn13?)
100 100
         $isbn = null;
101
-        $ids = (array)$volume->industryIdentifiers;
101
+        $ids = (array) $volume->industryIdentifiers;
102 102
         foreach ($ids as $id) {
103 103
             if (!isset($isbn) && in_array($id->type, ['ISBN_10', 'ISBN_13'])) {
104 104
                 $isbn = $id->identifier;
Please login to merge, or discard this patch.