Passed
Push — master ( 2556d0...3ec723 )
by Dispositif
02:20
created
src/Infrastructure/InternetDomainParser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 class InternetDomainParser
22 22
 {
23 23
     // todo inject/config ?
24
-    private const PATH_CACHE_PUBLIC_SUFFIX_LIST = __DIR__ . '/resources/public_suffix_list.dat';
24
+    private const PATH_CACHE_PUBLIC_SUFFIX_LIST = __DIR__.'/resources/public_suffix_list.dat';
25 25
 
26 26
     /**
27 27
      * https://www.google.fr => google.fr
Please login to merge, or discard this patch.
src/Application/Http/ExternHttpClient.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -61,20 +61,20 @@  discard block
 block discarded – undo
61 61
         // idn_to_ascii('teßt.com',IDNA_NONTRANSITIONAL_TO_ASCII,INTL_IDNA_VARIANT_UTS46)
62 62
         // checkdnsrr($string, "A") // check DNS record
63 63
         if (!self::isHttpURL($url)) {
64
-            throw new DomainException('URL not compatible : ' . $url);
64
+            throw new DomainException('URL not compatible : '.$url);
65 65
         }
66 66
         $response = $this->client->get($url);
67 67
 
68 68
         if (200 !== $response->getStatusCode()) {
69
-            echo 'HTTP error ' . $response->getStatusCode();
69
+            echo 'HTTP error '.$response->getStatusCode();
70 70
             if ($this->log !== null) {
71
-                $this->log->error('HTTP error ' . $response->getStatusCode() . ' ' . $response->getReasonPhrase());
71
+                $this->log->error('HTTP error '.$response->getStatusCode().' '.$response->getReasonPhrase());
72 72
             }
73 73
 
74 74
             return null;
75 75
         }
76 76
 
77
-        $html = (string)$response->getBody()->getContents() ?? '';
77
+        $html = (string) $response->getBody()->getContents() ?? '';
78 78
 
79 79
         return ($normalized) ? $this->normalizeHtml($html, $url) : $html;
80 80
     }
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
      */
86 86
     public static function isHttpURL(string $url): bool
87 87
     {
88
-        return (bool)preg_match('#^https?://[^ ]+$#i', $url);
88
+        return (bool) preg_match('#^https?://[^ ]+$#i', $url);
89 89
     }
90 90
 
91 91
     /**
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         $charset = $this->extractCharset($html) ?? 'WINDOWS-1252';
113 113
 
114 114
         if (empty($charset)) {
115
-            throw new DomainException('normalized html error and no charset found : ' . $url);
115
+            throw new DomainException('normalized html error and no charset found : '.$url);
116 116
         }
117 117
         try {
118 118
             $html2 = iconv($charset, 'UTF-8//TRANSLIT', $html);
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
                 return '';
122 122
             }
123 123
         } catch (Throwable $e) {
124
-            throw new DomainException("error converting : $charset to UTF-8" . $url, $e->getCode(), $e);
124
+            throw new DomainException("error converting : $charset to UTF-8".$url, $e->getCode(), $e);
125 125
         }
126 126
 
127 127
         return $html2;
Please login to merge, or discard this patch.
src/Domain/Models/Wiki/AbstractStrictWikiTemplate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@
 block discarded – undo
155 155
     protected function isValidParamName($name): bool
156 156
     {
157 157
         if (is_int($name)) {
158
-            $name = (string)$name;
158
+            $name = (string) $name;
159 159
         }
160 160
         // that parameter exists in template ?
161 161
         // @phpstan-ignore-next-line
Please login to merge, or discard this patch.
src/Application/OuvrageCompleteWorker.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -328,7 +328,7 @@
 block discarded – undo
328 328
             'modifs' => mb_substr(implode(',', $this->getSummaryLog()), 0, 250),
329 329
             'notcosmetic' => ($this->notCosmetic) ? 1 : 0,
330 330
             'major' => ($this->major) ? 1 : 0,
331
-            'isbn' => substr($isbn,0,19),
331
+            'isbn' => substr($isbn, 0, 19),
332 332
             'version' => WikiBotConfig::VERSION ?? null,
333 333
         ];
334 334
         $this->log->info('finalData', $finalData);
Please login to merge, or discard this patch.
src/Domain/Publisher/ExternConverterTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -111,10 +111,10 @@  discard block
 block discarded – undo
111 111
         if (isset($meta['citation_firstpage'])) {
112 112
             $page = $meta['citation_firstpage'];
113 113
             if (isset($meta['citation_lastpage'])) {
114
-                $page .= '–' . $meta['citation_lastpage'];
114
+                $page .= '–'.$meta['citation_lastpage'];
115 115
             }
116 116
 
117
-            return (string)$page;
117
+            return (string) $page;
118 118
         }
119 119
 
120 120
         return null;
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
                 $this->log->notice('EXCEPTION DATE');
341 341
             }
342 342
 
343
-            return '<!-- ' . $str . ' -->';
343
+            return '<!-- '.$str.' -->';
344 344
         }
345 345
 
346 346
         return $date->format('d-m-Y');
Please login to merge, or discard this patch.
src/Application/Examples/testExternLink.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
     // Attention : pas de post-processing (sanitize title, etc.)
35 35
     $result = $trans->process($url, $summary);
36 36
 } catch (Exception $e) {
37
-    echo "EXCEPTION ". $e->getMessage().$e->getFile().$e->getLine();
37
+    echo "EXCEPTION ".$e->getMessage().$e->getFile().$e->getLine();
38 38
 }
39 39
 
40 40
 echo $result."\n";
Please login to merge, or discard this patch.
src/Domain/Utils/TextUtil.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -274,7 +274,7 @@
 block discarded – undo
274 274
         if (mb_strlen($text) > $maxLength) {
275 275
             $spacePos = mb_strrpos(mb_substr($text, 0, $maxLength), ' ');
276 276
             $spacePos = ($spacePos > ($maxLength - 12)) ? $spacePos : $maxLength;
277
-            $text = trim(mb_substr($text, 0, $spacePos)) . self::SYMBOL_TEXT_CUT;
277
+            $text = trim(mb_substr($text, 0, $spacePos)).self::SYMBOL_TEXT_CUT;
278 278
         }
279 279
 
280 280
         return $text;
Please login to merge, or discard this patch.
src/Domain/Publisher/SeoSanitizer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         }
47 47
 
48 48
         // rebuild bestTitle but keep only the first 2 SEO segments
49
-        return trim($seoSegmentsFiltered[0]) . self::REBUILD_SEPARATOR . trim($seoSegmentsFiltered[1]);
49
+        return trim($seoSegmentsFiltered[0]).self::REBUILD_SEPARATOR.trim($seoSegmentsFiltered[1]);
50 50
     }
51 51
 
52 52
     private function extractSEOSegments(string $title): array
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 
91 91
         return array_values(array_filter(
92 92
             $seoSegments,
93
-            function ($segment) use ($prettyDomainName, $siteName) {
93
+            function($segment) use ($prettyDomainName, $siteName) {
94 94
                 $strippedSegment = str_replace(
95 95
                     [' ', '-'],
96 96
                     '',
Please login to merge, or discard this patch.
src/Application/ExternRefWorker.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -125,8 +125,7 @@
 block discarded – undo
125 125
         }
126 126
         if (isset($this->summary->memo['count lien brisé'])) {
127 127
             $suffix .= ', ⚠️️️lien brisé'; //⚠️
Please login to merge, or discard this patch.