@@ -76,7 +76,7 @@ |
||
76 | 76 | //echo count($titles)." titles\n"; |
77 | 77 | $edited = file(__DIR__.'/../resources/article_externRef_edited.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); |
78 | 78 | $filtered = array_diff($titles, $edited); |
79 | -$list = new PageList( $filtered ); |
|
79 | +$list = new PageList($filtered); |
|
80 | 80 | echo ">".$list->count()." dans liste\n"; |
81 | 81 | |
82 | 82 | new ExternRefWorker($botConfig, $wiki, $list); |
@@ -37,25 +37,25 @@ discard block |
||
37 | 37 | $data = []; |
38 | 38 | |
39 | 39 | $monitor = $db->fetchRow('select count(id) from page_ouvrages where optidate is null and edited is null and skip=0'); |
40 | -$data['not analyzed citation'] = (int)$monitor['count(id)']; |
|
40 | +$data['not analyzed citation'] = (int) $monitor['count(id)']; |
|
41 | 41 | |
42 | 42 | $monitor = $db->fetchRow('select count(id) from page_ouvrages where optidate is not null'); |
43 | -$data['analyzed citation'] = (int)$monitor['count(id)']; |
|
43 | +$data['analyzed citation'] = (int) $monitor['count(id)']; |
|
44 | 44 | |
45 | 45 | $monitor = $db->fetchRow('select count(distinct page) as n from page_ouvrages where skip=1 and edited is null'); // ? |
46 | -$data['skip pages'] = (int)$monitor['n']; |
|
46 | +$data['skip pages'] = (int) $monitor['n']; |
|
47 | 47 | |
48 | 48 | $monitor = $db->fetchRow('select count(distinct page) as n from page_ouvrages where edited is true'); |
49 | -$data['edited pages'] = (int)$monitor['n']; |
|
49 | +$data['edited pages'] = (int) $monitor['n']; |
|
50 | 50 | |
51 | 51 | $monitor = $db->fetchRow('select count(id) from page_ouvrages where optidate > SUBDATE(NOW(),1)'); |
52 | -$data['analyzed citation 24H'] = (int)$monitor['count(id)']; |
|
52 | +$data['analyzed citation 24H'] = (int) $monitor['count(id)']; |
|
53 | 53 | |
54 | 54 | $monitor = $db->fetchRow('select count(id) as n from page_ouvrages where edited > SUBDATE(NOW(),1)'); |
55 | -$data['edited citations 24H'] = (int)$monitor['n']; |
|
55 | +$data['edited citations 24H'] = (int) $monitor['n']; |
|
56 | 56 | |
57 | 57 | $monitor = $db->fetchRow('select count(distinct page) as n from page_ouvrages where edited > SUBDATE(NOW(),1)'); |
58 | -$data['edited pages 24H'] = (int)$monitor['n']; |
|
58 | +$data['edited pages 24H'] = (int) $monitor['n']; |
|
59 | 59 | |
60 | 60 | $monitor = $db->fetchRow( |
61 | 61 | 'SELECT count(distinct A.page) FROM page_ouvrages A |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | AND A.page = B.page |
75 | 75 | )' |
76 | 76 | ); |
77 | -$data['waiting pages'] = (int)$monitor['count(distinct A.page)']; |
|
77 | +$data['waiting pages'] = (int) $monitor['count(distinct A.page)']; |
|
78 | 78 | |
79 | 79 | $data['currentdate'] = DateUtil::english2french((new DateTime())->format('j F Y \à H\:i').' (CEST)'); |
80 | 80 |
@@ -32,7 +32,7 @@ |
||
32 | 32 | try { |
33 | 33 | $result = $trans->process($url, $summary); |
34 | 34 | } catch (\Exception $e) { |
35 | - echo "EXCEPTION ". $e->getMessage().$e->getFile().$e->getLine(); |
|
35 | + echo "EXCEPTION ".$e->getMessage().$e->getFile().$e->getLine(); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | echo $result."\n"; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | private $options = []; |
38 | 38 | |
39 | - public function __construct(LoggerInterface $log, ?array $options=[]) |
|
39 | + public function __construct(LoggerInterface $log, ?array $options = []) |
|
40 | 40 | { |
41 | 41 | $this->log = $log; |
42 | 42 | $this->options = $options; |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $mapJson['DATA-TYPE'] = 'JSON-LD+META'; |
74 | 74 | } |
75 | 75 | // récupère "accès url" de OpenGraph (prévaut sur JSON:'isAccessibleForFree' |
76 | - if(isset($mapMeta['accès url']) ){ |
|
76 | + if (isset($mapMeta['accès url'])) { |
|
77 | 77 | $mapJson['accès url'] = $mapMeta['accès url']; |
78 | 78 | $mapJson['DATA-TYPE'] = 'JSON-LD+META'; |
79 | 79 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | throw new ConfigException('Pas de phrases disponibles'); |
107 | 107 | } |
108 | 108 | |
109 | - return (string)trim($sentences[array_rand($sentences)]); |
|
109 | + return (string) trim($sentences[array_rand($sentences)]); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | private function generateVoteInsertionText(): ?string |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | $html = $this->getAdminScoreHtml(); |
268 | 268 | |
269 | 269 | if (!empty($html) && preg_match('#<th>Total</th>[^<]*<th>(\d+)</th>#', $html, $matches)) { |
270 | - return (int)$matches[1]; |
|
270 | + return (int) $matches[1]; |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | return null; |
@@ -36,7 +36,7 @@ |
||
36 | 36 | $channel->basic_qos(null, 1, null); |
37 | 37 | // callback to $this->msgProcess(). |
38 | 38 | // TODO check Rector refac |
39 | - $channel->basic_consume(static::QUEUE_NAME, '', false, false, false, false, function (\PhpAmqpLib\Message\AMQPMessage $msg) : void { |
|
39 | + $channel->basic_consume(static::QUEUE_NAME, '', false, false, false, false, function(\PhpAmqpLib\Message\AMQPMessage $msg) : void { |
|
40 | 40 | $this->msgProcess($msg); |
41 | 41 | }); |
42 | 42 |
@@ -124,8 +124,7 @@ |
||
124 | 124 | } |
125 | 125 | if (isset($this->summary->memo['count lien brisé'])) { |
126 | 126 | $suffix .= ', ⚠️️️lien brisé'; //⚠️ |
@@ -206,9 +206,9 @@ discard block |
||
206 | 206 | */ |
207 | 207 | public function minutesSinceLastEdit(string $title): int |
208 | 208 | { |
209 | - $time = $this->getTimestamp($title); // 2011-09-02T16:31:13Z |
|
209 | + $time = $this->getTimestamp($title); // 2011-09-02T16:31:13Z |
|
210 | 210 | |
211 | - return (int)round((time() - strtotime($time)) / 60); |
|
211 | + return (int) round((time() - strtotime($time)) / 60); |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | /** |
@@ -224,8 +224,7 @@ discard block |
||
224 | 224 | { |
225 | 225 | $text = WikiTextUtil::removeHTMLcomments($text); |
226 | 226 | $botName = $botName ?: getenv('BOT_NAME'); |
227 | - $denyReg = (empty($botName)) ? '' : |
|
228 | - '|\{\{bots ?\| ?(optout|deny)\=[^\}]*'.preg_quote($botName, '#').'[^\}]*\}\}'; |
|
227 | + $denyReg = (empty($botName)) ? '' : '|\{\{bots ?\| ?(optout|deny)\=[^\}]*'.preg_quote($botName, '#').'[^\}]*\}\}'; |
|
229 | 228 | return preg_match('#({{nobots}}|{{bots ?\| ?(optout|deny) ?= ?all ?}}'.$denyReg.')#i', $text) > 0; |
230 | 229 | } |
231 | 230 |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $row['id'], |
112 | 112 | $this->raw |
113 | 113 | ) |
114 | - );; |
|
114 | + ); ; |
|
115 | 115 | $this->queueAdapter->skipRow((int) $row['id']); |
116 | 116 | sleep(10); |
117 | 117 | continue; |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | private function sendCompleted() |
321 | 321 | { |
322 | 322 | $isbn13 = $this->ouvrage->getParam('isbn'); |
323 | - if(!empty($isbn)) { |
|
323 | + if (!empty($isbn)) { |
|
324 | 324 | $isbn13 = substr($isbn13, 0, 19); |
325 | 325 | } |
326 | 326 | |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | 'modifs' => mb_substr(implode(',', $this->getSummaryLog()), 0, 250), |
333 | 333 | 'notcosmetic' => ($this->notCosmetic) ? 1 : 0, |
334 | 334 | 'major' => ($this->major) ? 1 : 0, |
335 | - 'isbn' => substr($isbn13,0,19), |
|
335 | + 'isbn' => substr($isbn13, 0, 19), |
|
336 | 336 | 'version' => WikiBotConfig::VERSION ?? null, |
337 | 337 | ]; |
338 | 338 | $this->log->info('finalData', $finalData); |