@@ -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; |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | } catch (Exception) { |
| 161 | 161 | // 23/11/2015 00:00:00 |
| 162 | 162 | if (isset($this->log) && method_exists($this->log, 'notice')) { |
| 163 | - $this->log->notice('tryFormatDateOrComment failed with ' . $str); |
|
| 163 | + $this->log->notice('tryFormatDateOrComment failed with '.$str); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | return sprintf('<!-- %s -->', $str); |
@@ -266,7 +266,7 @@ |
||
| 266 | 266 | * @return string|string[] |
| 267 | 267 | * @throws Throwable |
| 268 | 268 | */ |
| 269 | - private function processExternLinks(string $text, array $links): string|array |
|
| 269 | + private function processExternLinks(string $text, array $links): string | array |
|
| 270 | 270 | { |
| 271 | 271 | foreach ($links as $pattern) { |
| 272 | 272 | if ($this->quota->isQuotaReached()) { |
@@ -128,10 +128,10 @@ |
||
| 128 | 128 | JSON_THROW_ON_ERROR |
| 129 | 129 | ); |
| 130 | 130 | } catch (Throwable $e) { |
| 131 | - $this->log->error('Catch EDITOR_TITLES_FILENAME import ' . $e->getMessage()); |
|
| 131 | + $this->log->error('Catch EDITOR_TITLES_FILENAME import '.$e->getMessage()); |
|
| 132 | 132 | } |
| 133 | 133 | if (isset($data[$publisherName])) { |
| 134 | - return (string)urldecode((string) $data[$publisherName]); |
|
| 134 | + return (string) urldecode((string) $data[$publisherName]); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | return null; |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | { |
| 27 | 27 | protected const USER_RC_LIMIT = 100; |
| 28 | 28 | protected const TASK_NAME = ' |
@@ -28,7 +28,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 .= ' |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | |
| 39 | 39 | return OuvrageFactory::GoogleFromIsbn($this->isbn); |
| 40 | 40 | } catch (Throwable $e) { |
| 41 | - $this->logger->warning("*** ERREUR GOOGLE Isbn Search ***" . $e->getMessage()); |
|
| 41 | + $this->logger->warning("*** ERREUR GOOGLE Isbn Search ***".$e->getMessage()); |
|
| 42 | 42 | if (!str_contains($e->getMessage(), 'Could not resolve host: www.googleapis.com')) { |
| 43 | 43 | throw $e; |
| 44 | 44 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | class WikiBotConfig |
| 32 | 32 | { |
| 33 | 33 | public const VERSION = '2.0'; |
| 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']; |
@@ -96,9 +96,8 @@ discard block |
||
| 96 | 96 | { |
| 97 | 97 | $text = WikiTextUtil::removeHTMLcomments($text); |
| 98 | 98 | $botName = $botName ?: self::getBotName(); |
| 99 | - $denyReg = (empty($botName)) ? '' : |
|
| 100 | - '|\{\{bots ?\| ?(optout|deny)\=[^\}]*' . preg_quote($botName, '#') . '[^\}]*\}\}'; |
|
| 101 | - return preg_match('#({{nobots}}|{{bots ?\| ?(optout|deny) ?= ?all ?}}' . $denyReg . ')#i', $text) > 0; |
|
| 99 | + $denyReg = (empty($botName)) ? '' : '|\{\{bots ?\| ?(optout|deny)\=[^\}]*'.preg_quote($botName, '#').'[^\}]*\}\}'; |
|
| 100 | + return preg_match('#({{nobots}}|{{bots ?\| ?(optout|deny) ?= ?all ?}}'.$denyReg.')#i', $text) > 0; |
|
| 102 | 101 | } |
| 103 | 102 | |
| 104 | 103 | protected static function getBotOwner() |
@@ -152,7 +151,7 @@ discard block |
||
| 152 | 151 | |
| 153 | 152 | protected function getBotTalkPageTitle(): string |
| 154 | 153 | { |
| 155 | - return self::TALK_PAGE_PREFIX . $this::getBotName(); |
|
| 154 | + return self::TALK_PAGE_PREFIX.$this::getBotName(); |
|
| 156 | 155 | } |
| 157 | 156 | |
| 158 | 157 | /** |
@@ -263,8 +262,8 @@ discard block |
||
| 263 | 262 | */ |
| 264 | 263 | public function minutesSinceLastEdit(string $title): int |
| 265 | 264 | { |
| 266 | - $time = $this->getTimestamp($title); // 2011-09-02T16:31:13Z |
|
| 265 | + $time = $this->getTimestamp($title); // 2011-09-02T16:31:13Z |
|
| 267 | 266 | |
| 268 | - return (int)round((time() - strtotime($time)) / 60); |
|
| 267 | + return (int) round((time() - strtotime($time)) / 60); |
|
| 269 | 268 | } |
| 270 | 269 | } |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | { |
| 45 | 45 | foreach ($this->validators as $validator) { |
| 46 | 46 | if (!$validator instanceof ValidatorInterface) { |
| 47 | - throw new RuntimeException($validator::class . ' must implement ValidatorInterface.'); |
|
| 47 | + throw new RuntimeException($validator::class.' must implement ValidatorInterface.'); |
|
| 48 | 48 | } |
| 49 | 49 | if (!$validator->validate()) { |
| 50 | 50 | return false; |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | || $this->isTextCreatingError($this->ouvrageData['raw']) |
| 55 | 55 | ) { |
| 56 | 56 | $this->log->notice("SKIP: template avec commentaire HTML ou modèle problématique."); |
| 57 | - $this->db->skipRow((int)$this->ouvrageData['id']); |
|
| 57 | + $this->db->skipRow((int) $this->ouvrageData['id']); |
|
| 58 | 58 | |
| 59 | 59 | return false; |
| 60 | 60 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | $find = mb_strpos($this->wikiText, (string) $this->ouvrageData['raw']); |
| 73 | 73 | if ($find === false) { |
| 74 | 74 | $this->log->notice("String non trouvée."); |
| 75 | - $this->db->skipRow((int)$this->ouvrageData['id']); |
|
| 75 | + $this->db->skipRow((int) $this->ouvrageData['id']); |
|
| 76 | 76 | |
| 77 | 77 | return false; |
| 78 | 78 | } |