Passed
Push — dev ( bf3609...863855 )
by Dispositif
02:57
created
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/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/ImportOuvrageFromApi.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,14 +60,14 @@
 block discarded – undo
60 60
          */
61 61
         $data = $this->mapping($volume);
62 62
 
63
-        if(isset($data['infos'])) {
63
+        if (isset($data['infos'])) {
64 64
             $infos = $data['infos'];
65 65
             unset($data['infos']);
66 66
         }
67 67
 
68 68
         try {
69 69
             $this->ouvrage->hydrate($data);
70
-            if(isset($infos)) {
70
+            if (isset($infos)) {
71 71
                 $this->ouvrage->setInfos($infos);
72 72
             }
73 73
         } catch (Throwable $e) {
Please login to merge, or discard this patch.
src/Infrastructure/WikidataAdapter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
             $res = $this->searchByISNI($infos['ISNIAuteur1']);
41 41
         }
42 42
         if (isset($infos['isbn'])) {
43
-            if(!empty($res)) {
43
+            if (!empty($res)) {
44 44
                 sleep(2);
45 45
             }
46 46
             $res = array_merge($res, $this->findArticleByISBN13($infos['isbn']));
Please login to merge, or discard this patch.
src/Application/Examples/avancement.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,10 +40,10 @@
 block discarded – undo
40 40
 $db = new Mysql($pdo);
41 41
 
42 42
 $monitor = $db->fetchRow('select count(id) from temprawopti where optidate is not null');
43
-$number = (int)$monitor['count(id)'];
43
+$number = (int) $monitor['count(id)'];
44 44
 
45 45
 $monitor = $db->fetchRow('select count(distinct page) as pages from temprawopti where optidate is not null and isbn<>""');
46
-$pageNb = (int)$monitor['pages'];
46
+$pageNb = (int) $monitor['pages'];
47 47
 
48 48
 $newText = <<<EOF
49 49
 <div style="background:#EBF6E9;border:2px solid grey;padding:10px;border-radius:10px;">
Please login to merge, or discard this patch.
src/Domain/TypoTokenizer.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         // PUNCTUATION conversion
53 53
         $punctuationColl = array_filter(
54 54
             TextUtil::ALL_PUNCTUATION,
55
-            function ($value) {
55
+            function($value) {
56 56
                 // skip punctuation chars from mixed names (example : "Pierre-Marie L'Anglois")
57 57
                 return !in_array($value, ["'", '-', '-']);
58 58
             }
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
             }
72 72
             if (preg_match('#^(PATTERNINITIAL|PATTERNURL|PATTERNAND|PATTERNCOMMA|PATTERNBIBABREV|PATTERNPUNCTUATION)$#', $tok, $matches) > 0) {
73 73
 
74
-                $shortpattern = str_replace('PATTERN','', $tok);
74
+                $shortpattern = str_replace('PATTERN', '', $tok);
75 75
                 $res['pattern'] .= ' '.$shortpattern; // PATTERNAND -> AND
76 76
                 if (in_array($matches[1], ['PATTERNCOMMA', 'PATTERNPUNCTUATION']) || empty($matches[1])) {
77 77
                     $res['value'][] = '*';
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         $modText = preg_replace_callback_array(
129 129
             [
130 130
                 // URL
131
-                '#\bhttps?://[^ \]]+#i' => function ($match) {
131
+                '#\bhttps?://[^ \]]+#i' => function($match) {
132 132
                     // '#https?\:\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&amp;:/~\+\#]*[\w\-\@?^=%&amp;/~\+#])?#'
133 133
                     $this->tokenValue['URL'][] = $match[0];
134 134
 
@@ -136,26 +136,26 @@  discard block
 block discarded – undo
136 136
                 },
137 137
                 // BIBABREV : "dir.", "trad.", "(dir.)", "[dir.]", etc.
138 138
                 // TODO: regex flaw : "(" not evaluated in BIBABREV. Example : "(dir.)"
139
-                '#\b[(\[]?(collectif|coll\.|dir\.|trad\.|coord\.|ill\.)[)\]]?#i' => function ($match) {
139
+                '#\b[(\[]?(collectif|coll\.|dir\.|trad\.|coord\.|ill\.)[)\]]?#i' => function($match) {
140 140
                     $this->tokenValue['BIBABREV'][] = $match[0]; // [1] = dir
141 141
 
142 142
                     return ' PATTERNBIBABREV ';
143 143
                 },
144 144
                 // AND
145
-                '# (et|and|&|with|avec|e) #i' => function ($match) {
145
+                '# (et|and|&|with|avec|e) #i' => function($match) {
146 146
                     $this->tokenValue['AND'][] = $match[0];
147 147
 
148 148
                     return ' PATTERNAND ';
149 149
                 },
150 150
                 // COMMA
151
-                '#,#' => function () {
151
+                '#,#' => function() {
152 152
                     return ' PATTERNCOMMA ';
153 153
                 },
154 154
                 // INITIAL : 2) convert letter ("A.") or junior ("Jr.") or senior ("Sr.")
155 155
                 // extract initial before "." converted in PUNCTUATION
156 156
                 // Note : \b word boundary match between "L" and "'Amour" in "L'Amour"  (for [A-Z]\b)
157 157
                 // \b([A-Z]\. |[A-Z] |JR|Jr\.|Jr\b|Sr\.|Sr\b)+ for grouping "A. B." in same INITIAL ?
158
-                "#\b([A-Z]\.|[A-Z] |JR|Jr\.|Jr\b|Sr\.|Sr\b)#" => function ($match) {
158
+                "#\b([A-Z]\.|[A-Z] |JR|Jr\.|Jr\b|Sr\.|Sr\b)#" => function($match) {
159 159
                     $this->tokenValue['INITIAL'][] = $match[0];
160 160
 
161 161
                     return ' PATTERNINITIAL ';
Please login to merge, or discard this patch.
src/Application/CompleteProcess.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     public function __construct(QueueInterface $queueAdapter, ?bool $verbose = false)
51 51
     {
52 52
         $this->queueAdapter = $queueAdapter;
53
-        $this->verbose = (bool)$verbose;
53
+        $this->verbose = (bool) $verbose;
54 54
     }
55 55
 
56 56
     public function run(?int $limit = 10000)
@@ -138,8 +138,7 @@  discard block
 block discarded – undo
138 138
 
139 139
     private function onlineIsbnSearch(string $isbn, ?string $isbn10 = null)
140 140
     {
141
-        online:
142
-        if ($this->verbose) {
141
+        online : if ($this->verbose) {
143 142
             echo "sleep 10...\n";
144 143
         }
145 144
         sleep(10);
Please login to merge, or discard this patch.
src/Application/Examples/Monitor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
             [
95 95
                 'page' => $title ?? '',
96 96
                 'verify' => date("Y-m-d H:i:s"),
97
-                'altered' => (int)$stat,
97
+                'altered' => (int) $stat,
98 98
             ]
99 99
         );
100 100
     }
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
         }
151 151
 
152
-        return (int)round(($count - $found) / count($data) * 100);
152
+        return (int) round(($count - $found) / count($data) * 100);
153 153
     }
154 154
 
155 155
 }
Please login to merge, or discard this patch.
src/Application/Examples/CompleteWorker.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,5 +43,5 @@
 block discarded – undo
43 43
     }
44 44
     unset($process);
45 45
     echo "Sleep 10 min\n";
46
-    sleep(60*10);
46
+    sleep(60 * 10);
47 47
 }
Please login to merge, or discard this patch.