@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | if (count($res) >= 2 && empty($auteur2)) { |
| 187 | 187 | // delete author-params |
| 188 | 188 | array_map( |
| 189 | - function ($param) { |
|
| 189 | + function($param) { |
|
| 190 | 190 | $this->unsetParam($param); |
| 191 | 191 | }, |
| 192 | 192 | ['auteur', 'auteurs', 'prénom1', 'nom1'] |
@@ -723,7 +723,7 @@ discard block |
||
| 723 | 723 | // todo bug {{citation bloc}} si "=" ou "|" dans texte de citation |
| 724 | 724 | // Legacy : use {{début citation}} ... {{fin citation}} |
| 725 | 725 | if (preg_match('#[=|]#', $extrait) > 0) { |
| 726 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
| 726 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
| 727 | 727 | 'template' => 'début citation', |
| 728 | 728 | '1' => '', |
| 729 | 729 | 'raw' => '{{Début citation}}'.$extrait.'{{Fin citation}}', |
@@ -732,7 +732,7 @@ discard block |
||
| 732 | 732 | $this->notCosmetic = true; |
| 733 | 733 | } else { |
| 734 | 734 | // StdClass |
| 735 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
| 735 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
| 736 | 736 | 'template' => 'citation bloc', |
| 737 | 737 | '1' => $extrait, |
| 738 | 738 | 'raw' => '{{Citation bloc|'.$extrait.'}}', |
@@ -748,7 +748,7 @@ discard block |
||
| 748 | 748 | // "commentaire=bla" => {{Commentaire biblio|1=bla}} |
| 749 | 749 | if ($this->hasParamValue('commentaire')) { |
| 750 | 750 | $commentaire = $this->getParam('commentaire'); |
| 751 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
| 751 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
| 752 | 752 | 'template' => 'commentaire biblio', |
| 753 | 753 | '1' => $commentaire, |
| 754 | 754 | 'raw' => '{{Commentaire biblio|'.$commentaire.'}}', |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | ['[[wikilien]', 'wikilien'], |
| 108 | 108 | ['[[wiki|wikilien]]', 'wikilien'], |
| 109 | 109 | ['{{en}}', '{{en}}'], |
| 110 | - ['{{Lien|Jeffrey Robinson}}','Jeffrey Robinson'], |
|
| 110 | + ['{{Lien|Jeffrey Robinson}}', 'Jeffrey Robinson'], |
|
| 111 | 111 | ]; |
| 112 | 112 | } |
| 113 | 113 | } |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | { |
| 40 | 40 | return array_filter( |
| 41 | 41 | $myArray, |
| 42 | - function ($value) { |
|
| 42 | + function($value) { |
|
| 43 | 43 | return (null !== $value && '' !== $value); |
| 44 | 44 | } |
| 45 | 45 | ); |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | const EXIT_ON_CHECK_WATCHPAGE = false; |
| 31 | 31 | |
| 32 | 32 | // do not stop if they play with {stop} on bot talk page |
| 33 | - const BLACKLIST_EDITOR = ['NB80']; |
|
| 33 | + const BLACKLIST_EDITOR = ['NB80']; |
|
| 34 | 34 | |
| 35 | 35 | const BOT_FLAG = false; |
| 36 | 36 | |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | "\n*** STOP ON TALK PAGE BY %s ***\n\n", |
| 130 | 130 | $lastEditor |
| 131 | 131 | ); |
| 132 | - if(in_array($lastEditor, static::BLACKLIST_EDITOR)){ |
|
| 132 | + if (in_array($lastEditor, static::BLACKLIST_EDITOR)) { |
|
| 133 | 133 | return; |
| 134 | 134 | } |
| 135 | 135 | |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | */ |
| 222 | 222 | public function minutesSinceLastEdit(string $title): int |
| 223 | 223 | { |
| 224 | - $time = $this->getTimestamp($title); // 2011-09-02T16:31:13Z |
|
| 224 | + $time = $this->getTimestamp($title); // 2011-09-02T16:31:13Z |
|
| 225 | 225 | |
| 226 | 226 | return (int) round((time() - strtotime($time)) / 60); |
| 227 | 227 | } |
@@ -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;"> |
@@ -32,25 +32,25 @@ discard block |
||
| 32 | 32 | $data = []; |
| 33 | 33 | |
| 34 | 34 | $monitor = $db->fetchRow('select count(id) from page_ouvrages where optidate is null and edited is null'); |
| 35 | -$data['not analyzed citation'] = (int)$monitor['count(id)']; |
|
| 35 | +$data['not analyzed citation'] = (int) $monitor['count(id)']; |
|
| 36 | 36 | |
| 37 | 37 | $monitor = $db->fetchRow('select count(id) from page_ouvrages where optidate is not null'); |
| 38 | -$data['analyzed citation'] = (int)$monitor['count(id)']; |
|
| 38 | +$data['analyzed citation'] = (int) $monitor['count(id)']; |
|
| 39 | 39 | |
| 40 | 40 | $monitor = $db->fetchRow('select count(distinct page) as n from page_ouvrages where skip=1 and edited is null'); |
| 41 | -$data['skip pages'] = (int)$monitor['n']; |
|
| 41 | +$data['skip pages'] = (int) $monitor['n']; |
|
| 42 | 42 | |
| 43 | 43 | $monitor = $db->fetchRow('select count(distinct page) as n from page_ouvrages where edited is true'); |
| 44 | -$data['edited pages'] = (int)$monitor['n']; |
|
| 44 | +$data['edited pages'] = (int) $monitor['n']; |
|
| 45 | 45 | |
| 46 | 46 | $monitor = $db->fetchRow('select count(id) from page_ouvrages where optidate > SUBDATE(NOW(),1)'); |
| 47 | -$data['analyzed citation 24H'] = (int)$monitor['count(id)']; |
|
| 47 | +$data['analyzed citation 24H'] = (int) $monitor['count(id)']; |
|
| 48 | 48 | |
| 49 | 49 | $monitor = $db->fetchRow('select count(id) as n from page_ouvrages where edited > SUBDATE(NOW(),1)'); |
| 50 | -$data['edited citations 24H'] = (int)$monitor['n']; |
|
| 50 | +$data['edited citations 24H'] = (int) $monitor['n']; |
|
| 51 | 51 | |
| 52 | 52 | $monitor = $db->fetchRow('select count(distinct page) as n from page_ouvrages where edited > SUBDATE(NOW(),1)'); |
| 53 | -$data['edited pages 24H'] = (int)$monitor['n']; |
|
| 53 | +$data['edited pages 24H'] = (int) $monitor['n']; |
|
| 54 | 54 | |
| 55 | 55 | $monitor = $db->fetchRow('SELECT count(distinct A.page) FROM page_ouvrages A |
| 56 | 56 | WHERE notcosmetic=1. |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | ) |
| 66 | 66 | AND A.page = B.page |
| 67 | 67 | )'); |
| 68 | -$data['waiting pages'] = (int)$monitor['count(distinct A.page)']; |
|
| 68 | +$data['waiting pages'] = (int) $monitor['count(distinct A.page)']; |
|
| 69 | 69 | |
| 70 | 70 | $data['currentdate'] = DateUtil::dateEnglish2french((new DateTime())->format('j F Y \à H\:i').' (CEST)'); |
| 71 | 71 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | |
| 77 | 77 | $monitWiki = ''; |
| 78 | -if(!empty($monitor)) { |
|
| 78 | +if (!empty($monitor)) { |
|
| 79 | 79 | foreach ($monitor as $monit) { |
| 80 | 80 | // % = "%" |
| 81 | 81 | $edited = new DateTime($monit['edited']); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | "<tr><td>%s %</td><td>%s</td><td>[https://fr.wikipedia.org/w/index.php?title=%s&action=history histo]</td><td>[[%s]]</td><td>%s</td></tr>\n", |
| 84 | 84 | $monit['altered'] ?? '?', |
| 85 | 85 | $edited->format('d-m-Y'), |
| 86 | - str_replace(' ','_', $monit['page']), |
|
| 86 | + str_replace(' ', '_', $monit['page']), |
|
| 87 | 87 | $monit['page'] ?? '??', |
| 88 | 88 | $monit['version'] |
| 89 | 89 | ); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | wiki; |
| 120 | 120 | |
| 121 | 121 | $wikiText = str_replace('#monitor#', $monitWiki, $wikiText); |
| 122 | -foreach($data as $key => $dat){ |
|
| 122 | +foreach ($data as $key => $dat) { |
|
| 123 | 123 | $wikiText = str_replace('#'.$key.'#', $dat, $wikiText); |
| 124 | 124 | } |
| 125 | 125 | |
@@ -53,9 +53,9 @@ discard block |
||
| 53 | 53 | /** |
| 54 | 54 | * @var AbstractWikiTemplate |
| 55 | 55 | */ |
| 56 | - try{ |
|
| 56 | + try { |
|
| 57 | 57 | $tplObject = WikiTemplateFactory::create($tplName); |
| 58 | - }catch (Throwable $e){ |
|
| 58 | + } catch (Throwable $e) { |
|
| 59 | 59 | unset($e); |
| 60 | 60 | continue; |
| 61 | 61 | } |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | ) { |
| 191 | 191 | array_walk( |
| 192 | 192 | $matches, |
| 193 | - function (&$value) { |
|
| 193 | + function(&$value) { |
|
| 194 | 194 | $value = str_replace(['CURLYBRACKETO', 'CURLYBRACKETC'], ['{', '}'], $value); |
| 195 | 195 | } |
| 196 | 196 | ); |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | */ |
| 56 | 56 | try{ |
| 57 | 57 | $tplObject = WikiTemplateFactory::create($tplName); |
| 58 | - }catch (Throwable $e){ |
|
| 58 | + } catch (Throwable $e){ |
|
| 59 | 59 | unset($e); |
| 60 | 60 | continue; |
| 61 | 61 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $editInfo = new EditInfo(static::BOT_TALK_SUMMARY); |
| 64 | 64 | $success = $page->addToBottomOfThePage($addText, $editInfo); |
| 65 | 65 | |
| 66 | - return (bool)$success; |
|
| 66 | + return (bool) $success; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /** |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | throw new ConfigException('Pas de phrases disponibles pour TalkBot'); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - return (string)trim($sentences[array_rand($sentences)]); |
|
| 134 | + return (string) trim($sentences[array_rand($sentences)]); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /** |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | |
| 24 | 24 | public function hasWarning(): bool |
| 25 | 25 | { |
| 26 | - return (bool)$this->warning; |
|
| 26 | + return (bool) $this->warning; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /** |