Passed
Branch dev3 (493baa)
by Dispositif
02:30
created
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;
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
         } catch (Exception $e) {
165 165
             // 23/11/2015 00:00:00
166 166
             if (isset($this->log) && method_exists($this->log, 'notice')) {
167
-                $this->log->notice('tryFormatDateOrComment failed with ' . $str);
167
+                $this->log->notice('tryFormatDateOrComment failed with '.$str);
168 168
             }
169 169
 
170 170
             return sprintf('<!-- %s -->', $str);
Please login to merge, or discard this patch.
src/Application/ExternLink/RecentChangeWorker.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,15 +41,15 @@
 block discarded – undo
41 41
 
42 42
     public function trackUser(string $user): void
43 43
     {
44
-        echo "**** TRACK " . $user . "*****\n";
44
+        echo "**** TRACK ".$user."*****\n";
45 45
 
46 46
         $titles = $this->getLastEditsbyUser($user);
47 47
 
48 48
         // filter titles already in edited.txt
49 49
         $edited = file(__DIR__.'/resources/article_externRef_edited.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
50 50
         $filtered = array_diff($titles, $edited);
51
-        $list = new PageList( $filtered ); // TODO PageList factory in App ?
52
-        echo ">" . $list->count() . " dans liste\n";
51
+        $list = new PageList($filtered); // TODO PageList factory in App ?
52
+        echo ">".$list->count()." dans liste\n";
53 53
 
54 54
         $this->consumeList($list);
55 55
     }
Please login to merge, or discard this patch.
src/Application/OuvrageComplete/OuvrageCompleteWorker.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -333,7 +333,7 @@
 block discarded – undo
333 333
             'modifs' => mb_substr(implode(',', $this->getSummaryLog()), 0, 250),
334 334
             'notcosmetic' => ($this->notCosmetic) ? 1 : 0,
335 335
             'major' => ($this->major) ? 1 : 0,
336
-            'isbn' => substr($isbn,0,19),
336
+            'isbn' => substr($isbn, 0, 19),
337 337
             'version' => WikiBotConfig::VERSION ?? null,
338 338
         ];
339 339
         $this->logger->info('finalData', $finalData);
Please login to merge, or discard this patch.
src/Application/AbstractRefBotWorker.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 
24 24
     public function hasWarning(): bool
25 25
     {
26
-        return (bool)$this->warning;
26
+        return (bool) $this->warning;
27 27
     }
28 28
 
29 29
     /**
Please login to merge, or discard this patch.
src/Infrastructure/SMS.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
     {
42 42
         $sender = getenv('BOT_NAME') ?? '';
43 43
         $message = sprintf('%s : %s', $sender, $message);
44
-        $url = getenv('FREE_SMS_URL') . urlencode($message);
44
+        $url = getenv('FREE_SMS_URL').urlencode($message);
45 45
 
46 46
         $response = $this->client->get($url, ['timeout' => 120]);
47 47
 
Please login to merge, or discard this patch.
src/Application/WikiBotConfig.php 1 patch
Spacing   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 class WikiBotConfig
32 32
 {
33 33
     public const VERSION = '1.1';
34
-    public const WATCHPAGE_FILENAME = __DIR__ . '/resources/watch_pages.json';
34
+    public const WATCHPAGE_FILENAME = __DIR__.'/resources/watch_pages.json';
35 35
     public const EXIT_ON_CHECK_WATCHPAGE = false;
36 36
     // do not stop if they play with {stop} on bot talk page
37 37
     public const BLACKLIST_EDITOR = ['OrlodrimBot'];
@@ -88,9 +88,8 @@  discard block
 block discarded – undo
88 88
     {
89 89
         $text = WikiTextUtil::removeHTMLcomments($text);
90 90
         $botName = $botName ?: self::getBotName();
91
-        $denyReg = (empty($botName)) ? '' :
92
-            '|\{\{bots ?\| ?(optout|deny)\=[^\}]*' . preg_quote($botName, '#') . '[^\}]*\}\}';
93
-        return preg_match('#({{nobots}}|{{bots ?\| ?(optout|deny) ?= ?all ?}}' . $denyReg . ')#i', $text) > 0;
91
+        $denyReg = (empty($botName)) ? '' : '|\{\{bots ?\| ?(optout|deny)\=[^\}]*'.preg_quote($botName, '#').'[^\}]*\}\}';
92
+        return preg_match('#({{nobots}}|{{bots ?\| ?(optout|deny) ?= ?all ?}}'.$denyReg.')#i', $text) > 0;
94 93
     }
95 94
 
96 95
     protected static function getBotOwner()
@@ -144,7 +143,7 @@  discard block
 block discarded – undo
144 143
 
145 144
     protected function getBotTalkPageTitle(): string
146 145
     {
147
-        return self::TALK_PAGE_PREFIX . $this::getBotName();
146
+        return self::TALK_PAGE_PREFIX.$this::getBotName();
148 147
     }
149 148
 
150 149
     /**
@@ -255,8 +254,8 @@  discard block
 block discarded – undo
255 254
      */
256 255
     public function minutesSinceLastEdit(string $title): int
257 256
     {
258
-        $time = $this->getTimestamp($title);  // 2011-09-02T16:31:13Z
257
+        $time = $this->getTimestamp($title); // 2011-09-02T16:31:13Z
259 258
 
260
-        return (int)round((time() - strtotime($time)) / 60);
259
+        return (int) round((time() - strtotime($time)) / 60);
261 260
     }
262 261
 }
Please login to merge, or discard this patch.
src/Application/CLI/wikiScanProcess.php 1 patch
Indentation   +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
 // utilise une liste d'import wstat.fr
61
- echo "Liste d'après wstat.fr\n";
61
+    echo "Liste d'après wstat.fr\n";
62 62
 $list = PageList::FromFile(__DIR__.'/../resources/importISBN_nov.txt');
63 63
 new ScanWiki2DB($wiki, new DbAdapter(), new WikiBotConfig($wiki), $list, 0);
64 64
 
Please login to merge, or discard this patch.
src/Application/ExternLink/ExternRefWorker.php 1 patch
Spacing   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     public const SLEEP_AFTER_EDITION = 15; // sec
29 29
     public const MINUTES_DELAY_AFTER_LAST_HUMAN_EDIT = 10; // minutes
30 30
     public const CHECK_EDIT_CONFLICT = true;
31
-    public const ARTICLE_ANALYZED_FILENAME = __DIR__ . '/../resources/article_externRef_edited.txt';
31
+    public const ARTICLE_ANALYZED_FILENAME = __DIR__.'/../resources/article_externRef_edited.txt';
32 32
     public const SKIP_ADQ = false;
33 33
     public const SKIP_LASTEDIT_BY_BOT = false;
34 34
     public const CITATION_NUMBER_ON_FIRE = 15;
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
             $result = $this->transformer->process($refContent, $this->summary);
62 62
         } catch (Throwable $e) {
63 63
             echo "** Problème détecté 234242\n";
64
-            $this->log->critical($e->getMessage() . " " . $e->getFile() . ":" . $e->getLine());
64
+            $this->log->critical($e->getMessage()." ".$e->getFile().":".$e->getLine());
65 65
             // TODO : parse $e->message -> variable process, taskName, botflag...
66 66
 
67 67
             return $refContent;
@@ -121,10 +121,10 @@  discard block
 block discarded – undo
121 121
         $prefixSummary = ($this->summary->isBotFlag()) ? 'bot ' : '';
122 122
         $suffix = '';
123 123
         if (isset($this->summary->memo['count article'])) {
124
-            $suffix .= ' ' . $this->summary->memo['count article'] . 'x {article}';
124
+            $suffix .= ' '.$this->summary->memo['count article'].'x {article}';
125 125
         }
126 126
         if (isset($this->summary->memo['count lien web'])) {
127
-            $suffix .= ' ' . $this->summary->memo['count lien web'] . 'x {lien web}';
127
+            $suffix .= ' '.$this->summary->memo['count lien web'].'x {lien web}';
128 128
         }
129 129
         if (isset($this->summary->memo['presse'])) {
130 130
             $suffix .= ' 
Please login to merge, or discard this patch.
src/Application/OuvrageEdit/OuvrageEditWorker.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     public const DELAY_BOTFLAG_SECONDS = 60;
49 49
     public const DELAY_NO_BOTFLAG_SECONDS = 60;
50 50
     public const DELAY_MINUTES_AFTER_HUMAN_EDIT = 10;
51
-    public const ERROR_MSG_TEMPLATE = __DIR__ . '/templates/message_errors.wiki';
51
+    public const ERROR_MSG_TEMPLATE = __DIR__.'/templates/message_errors.wiki';
52 52
 
53 53
     /**
54 54
      * @var PageWorkStatus
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     {
96 96
         while (true) {
97 97
             echo "\n-------------------------------------\n\n";
98
-            echo date("Y-m-d H:i:s") . " ";
98
+            echo date("Y-m-d H:i:s")." ";
99 99
             $this->log->info($this->memory->getMemory(true));
100 100
             $this->pageProcess();
101 101
             sleep(2); // précaution boucle infinie
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
         try {
132 132
             $this->wikiPageAction = ServiceFactory::wikiPageAction($title); // , true ?
133 133
         } catch (Exception $e) {
134
-            $this->log->warning("*** WikiPageAction error : " . $title . " \n");
134
+            $this->log->warning("*** WikiPageAction error : ".$title." \n");
135 135
             sleep(20);
136 136
 
137 137
             return false;
@@ -201,16 +201,16 @@  discard block
 block discarded – undo
201 201
                     $this->sendOuvrageErrorsOnTalkPage($pageCitationCollection, $this->log);
202 202
                 }
203 203
             } catch (Throwable $e) {
204
-                $this->log->warning('Exception in editPage() ' . $e->getMessage());
204
+                $this->log->warning('Exception in editPage() '.$e->getMessage());
205 205
                 unset($e);
206 206
             }
207 207
 
208 208
             if (!$this->pageWorkStatus->botFlag) {
209
-                $this->log->debug("sleep " . self::DELAY_NO_BOTFLAG_SECONDS);
209
+                $this->log->debug("sleep ".self::DELAY_NO_BOTFLAG_SECONDS);
210 210
                 sleep(self::DELAY_NO_BOTFLAG_SECONDS);
211 211
             }
212 212
             if ($this->pageWorkStatus->botFlag) {
213
-                $this->log->debug("sleep " . self::DELAY_BOTFLAG_SECONDS);
213
+                $this->log->debug("sleep ".self::DELAY_BOTFLAG_SECONDS);
214 214
                 sleep(self::DELAY_BOTFLAG_SECONDS);
215 215
             }
216 216
         }
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 
221 221
     protected function printTitle(string $title): void
222 222
     {
223
-        echo Color::BG_CYAN . $title . Color::NORMAL . " \n";
223
+        echo Color::BG_CYAN.$title.Color::NORMAL." \n";
224 224
     }
225 225
 
226 226
     protected function checkArticleLabels($title): void
@@ -289,10 +289,10 @@  discard block
 block discarded – undo
289 289
 
290 290
     protected function printDebug(array $data)
291 291
     {
292
-        $this->log->debug('origin: ' . $data['raw']);
293
-        $this->log->debug('completed: ' . $data['opti']);
294
-        $this->log->debug('modifs: ' . $data['modifs']);
295
-        $this->log->debug('version: ' . $data['version']);
292
+        $this->log->debug('origin: '.$data['raw']);
293
+        $this->log->debug('completed: '.$data['opti']);
294
+        $this->log->debug('modifs: '.$data['modifs']);
295
+        $this->log->debug('version: '.$data['version']);
296 296
     }
297 297
 
298 298
     /**
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
                 $this->log->alert("*** Invalid CSRF token \n");
395 395
                 throw new Exception('Invalid CSRF token', $e->getCode(), $e);
396 396
             } else {
397
-                $this->log->warning('Exception in editPage() ' . $e->getMessage());
397
+                $this->log->warning('Exception in editPage() '.$e->getMessage());
398 398
                 sleep(10);
399 399
 
400 400
                 return false;
Please login to merge, or discard this patch.