@@ -78,7 +78,7 @@ |
||
78 | 78 | //echo count($titles)." titles\n"; |
79 | 79 | $edited = file(__DIR__.'/../resources/article_externRef_edited.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); |
80 | 80 | $filtered = array_diff($titles, $edited); |
81 | -$list = new PageList( $filtered ); |
|
81 | +$list = new PageList($filtered); |
|
82 | 82 | echo ">".$list->count()." dans liste\n"; |
83 | 83 | |
84 | 84 | new ExternRefWorker($botConfig, $wiki, $list, null, new InternetDomainParser()); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | class InternetDomainParser implements InternetDomainParserInterface |
23 | 23 | { |
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 | private readonly Rules $rules; |
27 | 27 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | public static function extractSubdomainString(string $httpURL): string |
56 | 56 | { |
57 | 57 | if (!HttpUtil::isHttpURL($httpURL)) { |
58 | - throw new Exception('string is not an URL ' . $httpURL); |
|
58 | + throw new Exception('string is not an URL '.$httpURL); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | return parse_url($httpURL, PHP_URL_HOST); |
@@ -43,7 +43,7 @@ |
||
43 | 43 | $webarchive = $this->archiver->searchWebarchive($url); |
44 | 44 | if ($webarchive instanceof WebarchiveDTO) { |
45 | 45 | $this->log->notice(' |
@@ -32,7 +32,7 @@ |
||
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 |
@@ -31,11 +31,11 @@ |
||
31 | 31 | ?LoggerInterface $logger = null): ExternPage |
32 | 32 | { |
33 | 33 | if (!HttpUtil::isHttpURL($url)) { |
34 | - throw new Exception('string is not an URL ' . $url); |
|
34 | + throw new Exception('string is not an URL '.$url); |
|
35 | 35 | } |
36 | 36 | $html = $httpClient->getHTML($url, true); |
37 | 37 | if (empty($html)) { |
38 | - throw new DomainException('No HTML from requested URL ' . $url); |
|
38 | + throw new DomainException('No HTML from requested URL '.$url); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | return new ExternPage($url, $html, new TagParser(), $domainParser, $logger); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | ) |
55 | 55 | { |
56 | 56 | if (!HttpUtil::isHttpURL($url)) { |
57 | - throw new Exception('string is not an URL ' . $url); |
|
57 | + throw new Exception('string is not an URL '.$url); |
|
58 | 58 | } |
59 | 59 | $this->url = $url; |
60 | 60 | } |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | { |
171 | 171 | try { |
172 | 172 | if (!HttpUtil::isHttpURL($this->url)) { |
173 | - throw new Exception('string is not an URL ' . $this->url); |
|
173 | + throw new Exception('string is not an URL '.$this->url); |
|
174 | 174 | } |
175 | 175 | if (!$this->domainParser instanceof InternetDomainParserInterface) { |
176 | 176 | $this->log->notice('InternetDomainParser is not set'); |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | return $this->domainParser->getRegistrableDomainFromURL($this->url); |
182 | 182 | } catch (Exception $e) { |
183 | 183 | if ($this->log !== null) { |
184 | - $this->log->warning('InternetDomainParser->getRegistrableDomainFromURL NULL ' . $this->url); |
|
184 | + $this->log->warning('InternetDomainParser->getRegistrableDomainFromURL NULL '.$this->url); |
|
185 | 185 | } |
186 | 186 | throw new Exception('InternetDomainParser->getRegistrableDomainFromURL NULL', $e->getCode(), $e); |
187 | 187 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $this->url = $url; |
50 | 50 | $this->registrableDomain = null; |
51 | 51 | if (!HttpUtil::isHttpURL($url)) { |
52 | - $this->log->debug('Skip : not a valid URL : ' . $url); |
|
52 | + $this->log->debug('Skip : not a valid URL : '.$url); |
|
53 | 53 | return false; |
54 | 54 | } |
55 | 55 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | return false; |
58 | 58 | } |
59 | 59 | if (!HttpUtil::isHttpURL($url)) { |
60 | - throw new Exception('string is not an URL ' . $url); |
|
60 | + throw new Exception('string is not an URL '.$url); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | $this->findRegistrableDomain(); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | try { |
80 | 80 | $this->registrableDomain = $this->internetDomainParser->getRegistrableDomainFromURL($this->url); |
81 | 81 | } catch (Exception) { |
82 | - $this->log->warning('Skip : not a valid URL : ' . $this->url); |
|
82 | + $this->log->warning('Skip : not a valid URL : '.$this->url); |
|
83 | 83 | return null; |
84 | 84 | } |
85 | 85 | return $this->registrableDomain; |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | protected function hasForbiddenFilenameExtension(): bool |
94 | 94 | { |
95 | - return (bool)preg_match( |
|
95 | + return (bool) preg_match( |
|
96 | 96 | '#\.(pdf|jpg|jpeg|gif|png|webp|xls|xlsx|xlr|xml|xlt|txt|csv|js|docx|exe|gz|zip|ini|movie|mp3|mp4|ogg|raw|rss|tar|tgz|wma)$#i', |
97 | 97 | $this->url |
98 | 98 | ); |
@@ -26,7 +26,7 @@ |
||
26 | 26 | { |
27 | 27 | protected const USER_RC_LIMIT = 100; |
28 | 28 | protected const TASK_NAME = ' |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | public const SLEEP_AFTER_EDITION = 15; // sec |
30 | 30 | public const MINUTES_DELAY_AFTER_LAST_HUMAN_EDIT = 10; // minutes |
31 | 31 | public const CHECK_EDIT_CONFLICT = true; |
32 | - public const ARTICLE_ANALYZED_FILENAME = __DIR__ . '/../resources/article_externRef_edited.txt'; |
|
32 | + public const ARTICLE_ANALYZED_FILENAME = __DIR__.'/../resources/article_externRef_edited.txt'; |
|
33 | 33 | public const SKIP_ADQ = false; |
34 | 34 | public const SKIP_LASTEDIT_BY_BOT = false; |
35 | 35 | public const CITATION_NUMBER_ON_FIRE = 15; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | try { |
62 | 62 | $result = $this->transformer->process($refContent, $this->summary); |
63 | 63 | } catch (Throwable $e) { |
64 | - $this->log->critical('Error patate34 '. $e->getMessage() . " " . $e->getFile() . ":" . $e->getLine()); |
|
64 | + $this->log->critical('Error patate34 '.$e->getMessage()." ".$e->getFile().":".$e->getLine()); |
|
65 | 65 | // TODO : parse $e->message -> variable process, taskName, botflag... |
66 | 66 | |
67 | 67 | return $refContent; |
@@ -132,10 +132,10 @@ discard block |
||
132 | 132 | $prefixSummary = ($this->summary->isBotFlag()) ? 'bot ' : ''; |
133 | 133 | $suffix = ''; |
134 | 134 | if (isset($this->summary->memo['count article'])) { |
135 | - $suffix .= ' ' . $this->summary->memo['count article'] . 'x {article}'; |
|
135 | + $suffix .= ' '.$this->summary->memo['count article'].'x {article}'; |
|
136 | 136 | } |
137 | 137 | if (isset($this->summary->memo['count lien web'])) { |
138 | - $suffix .= ' ' . $this->summary->memo['count lien web'] . 'x {lien web}'; |
|
138 | + $suffix .= ' '.$this->summary->memo['count lien web'].'x {lien web}'; |
|
139 | 139 | } |
140 | 140 | if (isset($this->summary->memo['presse'])) { |
141 | 141 | $suffix .= ' |