Passed
Push — master ( d76cad...d644e9 )
by Dispositif
14:09
created
src/Domain/Predict/TypoTokenizer.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         // PUNCTUATION conversion
50 50
         $punctuationColl = array_filter(
51 51
             TextUtil::ALL_PUNCTUATION,
52
-            function ($value) {
52
+            function($value) {
53 53
                 // skip punctuation chars from mixed names (example : "Pierre-Marie L'Anglois")
54 54
                 return !in_array($value, ["'", '-', '-']);
55 55
             }
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
             }
69 69
             if (preg_match('#^(PATTERNINITIAL|PATTERNURL|PATTERNAND|PATTERNCOMMA|PATTERNBIBABREV|PATTERNPUNCTUATION)$#', (string) $tok, $matches) > 0) {
70 70
 
71
-                $shortpattern = str_replace('PATTERN','', (string) $tok);
71
+                $shortpattern = str_replace('PATTERN', '', (string) $tok);
72 72
                 $res['pattern'] .= ' '.$shortpattern; // PATTERNAND -> AND
73 73
                 if (in_array($matches[1], ['PATTERNCOMMA', 'PATTERNPUNCTUATION']) || empty($matches[1])) {
74 74
                     $res['value'][] = '*';
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         return preg_replace_callback_array(
124 124
             [
125 125
                 // URL
126
-                '#\bhttps?://[^ \]]+#i' => function ($match): string {
126
+                '#\bhttps?://[^ \]]+#i' => function($match): string {
127 127
                     // '#https?\:\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+\#]*[\w\-\@?^=%&/~\+#])?#'
128 128
                     $this->tokenValue['URL'][] = $match[0];
129 129
 
@@ -131,26 +131,26 @@  discard block
 block discarded – undo
131 131
                 },
132 132
                 // BIBABREV : "dir.", "trad.", "(dir.)", "[dir.]", etc.
133 133
                 // TODO: regex flaw : "(" not evaluated in BIBABREV. Example : "(dir.)"
134
-                '#\b[(\[]?(collectif|coll\.|dir\.|trad\.|coord\.|ill\.)[)\]]?#i' => function ($match): string {
134
+                '#\b[(\[]?(collectif|coll\.|dir\.|trad\.|coord\.|ill\.)[)\]]?#i' => function($match): string {
135 135
                     $this->tokenValue['BIBABREV'][] = $match[0]; // [1] = dir
136 136
 
137 137
                     return ' PATTERNBIBABREV ';
138 138
                 },
139 139
                 // AND
140
-                '# (et|and|&|with|avec|e) #i' => function ($match): string {
140
+                '# (et|and|&|with|avec|e) #i' => function($match): string {
141 141
                     $this->tokenValue['AND'][] = $match[0];
142 142
 
143 143
                     return ' PATTERNAND ';
144 144
                 },
145 145
                 // COMMA
146
-                '#,#' => function (): string {
146
+                '#,#' => function(): string {
147 147
                     return ' PATTERNCOMMA ';
148 148
                 },
149 149
                 // INITIAL : 2) convert letter ("A.") or junior ("Jr.") or senior ("Sr.")
150 150
                 // extract initial before "." converted in PUNCTUATION
151 151
                 // Note : \b word boundary match between "L" and "'Amour" in "L'Amour"  (for [A-Z]\b)
152 152
                 // \b([A-Z]\. |[A-Z] |JR|Jr\.|Jr\b|Sr\.|Sr\b)+ for grouping "A. B." in same INITIAL ?
153
-                "#\b([A-Z]\.|[A-Z] |JR|Jr\.|Jr\b|Sr\.|Sr\b)#" => function ($match): string {
153
+                "#\b([A-Z]\.|[A-Z] |JR|Jr\.|Jr\b|Sr\.|Sr\b)#" => function($match): string {
154 154
                     $this->tokenValue['INITIAL'][] = $match[0];
155 155
 
156 156
                     return ' PATTERNINITIAL ';
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
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
     /**
41 41
      * @param mixed[] $options
42 42
      */
43
-    public function __construct(private readonly LoggerInterface $log, private readonly ?array $options = [])
43
+    public function __construct(private readonly LoggerInterface $log, private readonly ? array $options = [])
44 44
     {
45 45
     }
46 46
 
Please login to merge, or discard this patch.
src/Domain/Publisher/Traits/MapperConverterTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,10 +28,10 @@  discard block
 block discarded – undo
28 28
         if (isset($meta['citation_firstpage'])) {
29 29
             $page = $meta['citation_firstpage'];
30 30
             if (isset($meta['citation_lastpage'])) {
31
-                $page .= '–' . $meta['citation_lastpage'];
31
+                $page .= '–'.$meta['citation_lastpage'];
32 32
             }
33 33
 
34
-            return (string)$page;
34
+            return (string) $page;
35 35
         }
36 36
 
37 37
         return null;
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
         } catch (Exception) {
161 161
             // 23/11/2015 00:00:00
162 162
             if (isset($this->log) && method_exists($this->log, 'notice')) {
163
-                $this->log->notice('tryFormatDateOrComment failed with ' . $str);
163
+                $this->log->notice('tryFormatDateOrComment failed with '.$str);
164 164
             }
165 165
 
166 166
             return sprintf('<!-- %s -->', $str);
Please login to merge, or discard this patch.
src/Domain/WikiOptimizer/Handlers/EditeurHandler.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -128,10 +128,10 @@
 block discarded – undo
128 128
                 JSON_THROW_ON_ERROR
129 129
             );
130 130
         } catch (Throwable $e) {
131
-            $this->log->error('Catch EDITOR_TITLES_FILENAME import ' . $e->getMessage());
131
+            $this->log->error('Catch EDITOR_TITLES_FILENAME import '.$e->getMessage());
132 132
         }
133 133
         if (isset($data[$publisherName])) {
134
-            return (string)urldecode((string) $data[$publisherName]);
134
+            return (string) urldecode((string) $data[$publisherName]);
135 135
         }
136 136
 
137 137
         return null;
Please login to merge, or discard this patch.
src/Application/OuvrageComplete/Handlers/GoogleBooksHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 
39 39
             return OuvrageFactory::GoogleFromIsbn($this->isbn);
40 40
         } catch (Throwable $e) {
41
-            $this->logger->warning("*** ERREUR GOOGLE Isbn Search ***" . $e->getMessage());
41
+            $this->logger->warning("*** ERREUR GOOGLE Isbn Search ***".$e->getMessage());
42 42
             if (!str_contains($e->getMessage(), 'Could not resolve host: www.googleapis.com')) {
43 43
                 throw $e;
44 44
             }
Please login to merge, or discard this patch.
src/Application/OuvrageEdit/Validators/PageValidatorComposite.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
     {
45 45
         foreach ($this->validators as $validator) {
46 46
             if (!$validator instanceof ValidatorInterface) {
47
-                throw new RuntimeException($validator::class . ' must implement ValidatorInterface.');
47
+                throw new RuntimeException($validator::class.' must implement ValidatorInterface.');
48 48
             }
49 49
             if (!$validator->validate()) {
50 50
                 return false;
Please login to merge, or discard this patch.
src/Application/OuvrageEdit/Validators/CitationValidator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             || $this->isTextCreatingError($this->ouvrageData['raw'])
55 55
         ) {
56 56
             $this->log->notice("SKIP: template avec commentaire HTML ou modèle problématique.");
57
-            $this->db->skipRow((int)$this->ouvrageData['id']);
57
+            $this->db->skipRow((int) $this->ouvrageData['id']);
58 58
 
59 59
             return false;
60 60
         }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         $find = mb_strpos($this->wikiText, (string) $this->ouvrageData['raw']);
73 73
         if ($find === false) {
74 74
             $this->log->notice("String non trouvée.");
75
-            $this->db->skipRow((int)$this->ouvrageData['id']);
75
+            $this->db->skipRow((int) $this->ouvrageData['id']);
76 76
 
77 77
             return false;
78 78
         }
Please login to merge, or discard this patch.
src/Application/OuvrageEdit/OuvrageEditSummaryTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
         $prefix = ($this->pageWorkStatus->botFlag) ? 'bot ' : '';
72 72
         $prefix .= (empty($this->pageWorkStatus->errorWarning)) ? '' : ' ⚠️'; // AdQ, BA
73 73
 
74
-        return $prefix . ((empty($this->pageWorkStatus->featured_article)) ? '' : ' ☆');
74
+        return $prefix.((empty($this->pageWorkStatus->featured_article)) ? '' : ' ☆');
75 75
     }
76 76
 
77 77
     /**
Please login to merge, or discard this patch.
src/Application/WikiPageAction.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             $this->page = $wiki->newPageGetter()->getFromTitle($title);
55 55
             $this->ns = $this->page->getPageIdentifier()->getTitle()->getNs();
56 56
         } catch (Throwable $e) {
57
-            throw new Exception('Erreur construct WikiPageAction ' . $e->getMessage() . $e->getFile() . $e->getLine(), $e->getCode(), $e);
57
+            throw new Exception('Erreur construct WikiPageAction '.$e->getMessage().$e->getFile().$e->getLine(), $e->getCode(), $e);
58 58
         }
59 59
     }
60 60
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         // "{{en}} {{zh}} {{ouvrage...}}"
74 74
         // todo test U
75 75
         if (preg_match_all(
76
-            '#(?<langTemp>{{[a-z][a-z]}} ?{{[a-z][a-z]}}) ?' . preg_quote($tplOrigin, '#') . '#i',
76
+            '#(?<langTemp>{{[a-z][a-z]}} ?{{[a-z][a-z]}}) ?'.preg_quote($tplOrigin, '#').'#i',
77 77
             $text,
78 78
             $matches
79 79
         )
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         // hack // todo: autres patterns {{en}} ?
88 88
         // OK : {{en}} \n {{ouvrage}}
89 89
         if (preg_match_all(
90
-                "#(?<langTemp>{{(?<lang>[a-z][a-z])}} *\n?)?" . preg_quote($tplOrigin, '#') . '#i',
90
+                "#(?<langTemp>{{(?<lang>[a-z][a-z])}} *\n?)?".preg_quote($tplOrigin, '#').'#i',
91 91
                 $text,
92 92
                 $matches
93 93
             ) > 0
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
                 // example : {{en}} {{template|lang=ru}}
103 103
                 if (!empty($lang) && self::SKIP_LANG_INDICATOR !== $lang
104 104
                     && preg_match('#langue *=#', $tplReplace)
105
-                    && !preg_match('#langue *= ?' . $lang . '#i', $tplReplace)
105
+                    && !preg_match('#langue *= ?'.$lang.'#i', $tplReplace)
106 106
                     && !preg_match('#\| ?langue *= ?\n?\|#', $tplReplace)
107 107
                 ) {
108 108
                     echo sprintf(
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
                 // FIX dirty : {{en}} mais langue= avec value non définie sur new template...
126 126
                 if (!empty($lang) && preg_match('#\| ?(langue *=) ?\n? ?\|#', $tplReplace, $matchLangue) > 0) {
127 127
                     $previousTpl = $tplReplace;
128
-                    $tplReplace = str_replace($matchLangue[1], 'langue=' . $lang, $tplReplace);
128
+                    $tplReplace = str_replace($matchLangue[1], 'langue='.$lang, $tplReplace);
129 129
                     //dump('origin', $tplOrigin);
130 130
                     $text = str_replace($previousTpl, $tplReplace, $text);
131 131
                 }
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
                 // replace {template} and {{lang}} {template}
141 141
                 $text = str_replace($mention, $tplReplace, $text);
142 142
                 $text = str_replace(
143
-                    $matches['langTemp'][$num] . $tplReplace,
143
+                    $matches['langTemp'][$num].$tplReplace,
144 144
                     $tplReplace,
145 145
                     $text
146 146
                 ); // si 1er replace global sans
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
     public function getRedirect(): ?string
211 211
     {
212 212
         if ($this->getText() && preg_match('/^#REDIRECT(?:ION)? ?\[\[([^]]+)]]/i', $this->getText(), $matches)) {
213
-            return (string)trim($matches[1]);
213
+            return (string) trim($matches[1]);
214 214
         }
215 215
 
216 216
         return null;
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
             throw new Exception('That page does not exist');
260 260
         }
261 261
         $oldText = $this->getText();
262
-        $newText = $oldText . "\n" . $addText;
262
+        $newText = $oldText."\n".$addText;
263 263
 
264 264
         return $this->editPage($newText, $editInfo);
265 265
     }
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
             throw new Exception('That page does not exist');
316 316
         }
317 317
         $oldText = $this->getText();
318
-        $newText = $addText . $oldText;
318
+        $newText = $addText.$oldText;
319 319
 
320 320
         return $this->editPage($newText, $editInfo);
321 321
     }
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
         foreach ($refs as $ref) {
344 344
             if (preg_match(
345 345
                     '#(?<url>https?://(?:www\.)?lemonde\.fr/[^ \]]+)#i',
346
-                    (string)$ref,
346
+                    (string) $ref,
347 347
                     $matches
348 348
                 ) > 0
349 349
             ) {
Please login to merge, or discard this patch.