@@ -58,7 +58,7 @@ |
||
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(), $list, 0); |
64 | 64 |
@@ -40,10 +40,10 @@ |
||
40 | 40 | $db = new Mysql($pdo); |
41 | 41 | |
42 | 42 | $monitor = $db->fetchRow('select count(id) from page_ouvrages where optidate is not null'); |
43 | -$number = (int)$monitor['count(id)']; |
|
43 | +$number = (int) $monitor['count(id)']; |
|
44 | 44 | |
45 | 45 | $monitor = $db->fetchRow('select count(distinct page) as pages from page_ouvrages where optidate is not null and isbn<>""'); |
46 | -$pageNb = (int)$monitor['pages']; |
|
46 | +$pageNb = (int) $monitor['pages']; |
|
47 | 47 | |
48 | 48 | $newText = <<<EOF |
49 | 49 | <div style="background:#EBF6E9;border:2px solid grey;padding:10px;border-radius:10px;"> |
@@ -333,7 +333,7 @@ |
||
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); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $this->url = $url; |
50 | 50 | $this->registrableDomain = null; |
51 | 51 | if (!ExternHttpClient::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 (!ExternHttpClient::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 $e) { |
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|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 | ); |
@@ -11,5 +11,5 @@ |
||
11 | 11 | |
12 | 12 | interface ExternHttpClientInterface |
13 | 13 | { |
14 | - public function getHTML(string $url, ?bool $normalized=false): ?string; |
|
14 | + public function getHTML(string $url, ?bool $normalized = false): ?string; |
|
15 | 15 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | $this->summary->memo['sites'][] = $this->externalPage->getPrettyDomainName(); // ??? |
34 | 34 | } |
35 | 35 | if (isset($mapData['accès url'])) { |
36 | - $this->log->debug('accès |
@@ -28,10 +28,10 @@ discard block |
||
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 |
||
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); |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | public const SLEEP_AFTER_EDITION = 15; // sec |
28 | 28 | public const MINUTES_DELAY_AFTER_LAST_HUMAN_EDIT = 10; // minutes |
29 | 29 | public const CHECK_EDIT_CONFLICT = true; |
30 | - public const ARTICLE_ANALYZED_FILENAME = __DIR__ . '/resources/article_externRef_edited.txt'; |
|
30 | + public const ARTICLE_ANALYZED_FILENAME = __DIR__.'/resources/article_externRef_edited.txt'; |
|
31 | 31 | public const SKIP_ADQ = false; |
32 | 32 | public const SKIP_LASTEDIT_BY_BOT = false; |
33 | 33 | public const CITATION_NUMBER_ON_FIRE = 15; |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $result = $this->transformer->process($refContent, $this->summary); |
61 | 61 | } catch (Throwable $e) { |
62 | 62 | echo "** Problème détecté 234242\n"; |
63 | - $this->log->critical($e->getMessage() . " " . $e->getFile() . ":" . $e->getLine()); |
|
63 | + $this->log->critical($e->getMessage()." ".$e->getFile().":".$e->getLine()); |
|
64 | 64 | // TODO : parse $e->message -> variable process, taskName, botflag... |
65 | 65 | |
66 | 66 | return $refContent; |
@@ -120,10 +120,10 @@ discard block |
||
120 | 120 | $prefixSummary = ($this->summary->isBotFlag()) ? 'bot ' : ''; |
121 | 121 | $suffix = ''; |
122 | 122 | if (isset($this->summary->memo['count article'])) { |
123 | - $suffix .= ' ' . $this->summary->memo['count article'] . 'x {article}'; |
|
123 | + $suffix .= ' '.$this->summary->memo['count article'].'x {article}'; |
|
124 | 124 | } |
125 | 125 | if (isset($this->summary->memo['count lien web'])) { |
126 | - $suffix .= ' ' . $this->summary->memo['count lien web'] . 'x {lien web}'; |
|
126 | + $suffix .= ' '.$this->summary->memo['count lien web'].'x {lien web}'; |
|
127 | 127 | } |
128 | 128 | if (isset($this->summary->memo['presse'])) { |
129 | 129 | $suffix .= ' |