Passed
Push — master ( 860b7e...86fe81 )
by Dispositif
03:31
created
src/Domain/WikiOptimizer/Handlers/LocationHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 
19 19
 class LocationHandler extends AbstractOuvrageHandler
20 20
 {
21
-    final public const TRANSLATE_CITY_FR = __DIR__ . '/../../resources/traduction_ville.csv';
21
+    final public const TRANSLATE_CITY_FR = __DIR__.'/../../resources/traduction_ville.csv';
22 22
 
23 23
     /**
24 24
      * @var PageListInterface
Please login to merge, or discard this patch.
src/Domain/WikiOptimizer/OuvrageOptimize.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
 {
36 36
     final public const CONVERT_GOOGLEBOOK_TEMPLATE = false; // change OuvrageOptimizeTest !!
37 37
     final public const WIKI_LANGUAGE = 'fr';
38
-    final public const PUBLISHER_FRWIKI_FILENAME = __DIR__ . '/../resources/data_editors_wiki.json';
38
+    final public const PUBLISHER_FRWIKI_FILENAME = __DIR__.'/../resources/data_editors_wiki.json';
39 39
 
40 40
     /**
41 41
      * @var OptiStatus
Please login to merge, or discard this patch.
src/Domain/ExternLink/DeadLinkTransformer.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
                 if ($webarchiveDTO->getArchiver() === '[[Internet Archive]]') {
57 57
                     $this->log->notice('
Please login to merge, or discard this patch.
src/Domain/ExternLink/SummaryExternTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
             $this->summary->memo['sites'][] = $this->externalPage->getPrettyDomainName(); // ???
33 33
         }
34 34
         if (isset($mapData['accès url'])) {
35
-            $this->log->debug('accès 
Please login to merge, or discard this patch.
src/Infrastructure/InternetArchiveAdapter.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         return new WebarchiveDTO(
46 46
             self::ARCHIVER_NAME,
47 47
             $url,
48
-            (string)$archiveData['url'],
48
+            (string) $archiveData['url'],
49 49
             $iaDateOrNull
50 50
         );
51 51
     }
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     protected function requestInternetArchiveApi(string $url, ?DateTimeInterface $date = null): array
54 54
     {
55 55
         $response = $this->client->get(
56
-            'https://archive.org/wayback/available?timestamp=' . self::SEARCH_CLOSEST_TIMESTAMP . '&url=' . urlencode($url),
56
+            'https://archive.org/wayback/available?timestamp='.self::SEARCH_CLOSEST_TIMESTAMP.'&url='.urlencode($url),
57 57
             [
58 58
                 'timeout' => 20,
59 59
                 'allow_redirects' => true,
@@ -103,14 +103,14 @@  discard block
 block discarded – undo
103 103
         }
104 104
         $iaDateTime = new DateTime();
105 105
         $iaDateTime->setDate(
106
-            (int)substr($iaTimestamp, 0, 4),
107
-            (int)substr($iaTimestamp, 4, 2),
108
-            (int)substr($iaTimestamp, 6, 2)
106
+            (int) substr($iaTimestamp, 0, 4),
107
+            (int) substr($iaTimestamp, 4, 2),
108
+            (int) substr($iaTimestamp, 6, 2)
109 109
         );
110 110
         $iaDateTime->setTime(
111
-            (int)substr($iaTimestamp, 8, 2),
112
-            (int)substr($iaTimestamp, 10, 2),
113
-            (int)substr($iaTimestamp, 12, 2)
111
+            (int) substr($iaTimestamp, 8, 2),
112
+            (int) substr($iaTimestamp, 10, 2),
113
+            (int) substr($iaTimestamp, 12, 2)
114 114
         );
115 115
 
116 116
         return $iaDateTime;
Please login to merge, or discard this patch.
src/Application/AbstractRefBotWorker.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
     public function hasWarning(): bool
26 26
     {
27
-        return (bool)$this->warning;
27
+        return (bool) $this->warning;
28 28
     }
29 29
 
30 30
     /**
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         $refs = array_slice($refs, 0, self::MAX_REFS_PROCESSED_IN_ARTICLE, true);
56 56
 
57 57
         foreach ($refs as $ref) {
58
-            $refContent = WikiTextUtil::stripFinalPoint(trim((string)$ref[1]));
58
+            $refContent = WikiTextUtil::stripFinalPoint(trim((string) $ref[1]));
59 59
 
60 60
             $newRefContent = $this->processRefContent($refContent);
61 61
 
@@ -70,11 +70,11 @@  discard block
 block discarded – undo
70 70
     protected function replaceRefInText(array $ref, string $replace, string $text)
71 71
     {
72 72
         // Pas de changement
73
-        if (WikiTextUtil::stripFinalPoint(trim($replace)) === WikiTextUtil::stripFinalPoint(trim((string)$ref[1]))) {
73
+        if (WikiTextUtil::stripFinalPoint(trim($replace)) === WikiTextUtil::stripFinalPoint(trim((string) $ref[1]))) {
74 74
             return $text;
75 75
         }
76 76
         $replace = $this->addFinalPeriod($ref[0], $replace);
77
-        $result = str_replace($ref[1], $replace, (string)$ref[0]);
77
+        $result = str_replace($ref[1], $replace, (string) $ref[0]);
78 78
         $this->printDiff($ref[0], $result);
79 79
 
80 80
         return str_replace($ref[0], $result, $text);
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
      */
86 86
     protected function addFinalPeriod($ref, string $replace): string
87 87
     {
88
-        if (preg_match('#</ref>#', (string)$ref)) {
88
+        if (preg_match('#</ref>#', (string) $ref)) {
89 89
             $replace .= '.';
90 90
         }
91 91
         return $replace;
Please login to merge, or discard this patch.
src/Application/CLI/lastExternRefProcess.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,10 +56,10 @@
 block discarded – undo
56 56
 $titles = $list->getPageTitles();
57 57
 unset($list);
58 58
 //echo count($titles)." titles\n";
59
-$edited = file(__DIR__ . '/../resources/article_externRef_edited.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
59
+$edited = file(__DIR__.'/../resources/article_externRef_edited.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
60 60
 $filtered = array_diff($titles, $edited);
61 61
 $list = new PageList($filtered);
62
-echo ">" . $list->count() . " dans liste\n";
62
+echo ">".$list->count()." dans liste\n";
63 63
 
64 64
 
65 65
 $httpClient = ServiceFactory::getHttpClient();
Please login to merge, or discard this patch.
src/Application/CLI/testExternLink.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
 // todo command --tor --wikiwix --internetarchive
39 39
 $torEnabled = false;
40
-echo "TOR enabled : ".($torEnabled ? "oui" : "non"). "\n";
40
+echo "TOR enabled : ".($torEnabled ? "oui" : "non")."\n";
41 41
 
42 42
 $client = ServiceFactory::getHttpClient();
43 43
 $wikiwix = new WikiwixAdapter($client, $logger);
@@ -56,10 +56,10 @@  discard block
 block discarded – undo
56 56
     // Attention : pas de post-processing (sanitize title, etc.)
57 57
     $result = $trans->process($url, $summary);
58 58
 } catch (Exception $e) {
59
-    $result = "EXCEPTION ". $e->getMessage().$e->getFile().$e->getLine();
59
+    $result = "EXCEPTION ".$e->getMessage().$e->getFile().$e->getLine();
60 60
 }
61 61
 
62
-echo '>>> '. $result."\n";
62
+echo '>>> '.$result."\n";
63 63
 
64 64
 
65 65
 
Please login to merge, or discard this patch.
src/Application/CLI/externRefProcess.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -54,23 +54,23 @@
 block discarded – undo
54 54
     $list = new PageList([trim($argv[1])]);
55 55
 
56 56
     // delete Title from edited.txt
57
-    $file = __DIR__ . '/../resources/article_externRef_edited.txt';
57
+    $file = __DIR__.'/../resources/article_externRef_edited.txt';
58 58
     $text = file_get_contents($file);
59
-    $newText = str_replace(trim($argv[1]) . "\n", '', $text);
59
+    $newText = str_replace(trim($argv[1])."\n", '', $text);
60 60
     if (!empty($text) && $text !== $newText) {
61 61
         @file_put_contents($file, $newText);
62 62
     }
63
-    $botConfig->taskName = '
Please login to merge, or discard this patch.