@@ -111,7 +111,7 @@ |
||
| 111 | 111 | { |
| 112 | 112 | // Style "auto1234" |
| 113 | 113 | if (empty($this->getParam('périodique') || empty($this->getParam('date')))) { |
| 114 | - return 'auto'.(string)rand(1000, 9999); |
|
| 114 | + return 'auto'.(string) rand(1000, 9999); |
|
| 115 | 115 | } |
| 116 | 116 | // Style "LeMonde15022017" |
| 117 | 117 | $periodique = str_replace( |
@@ -258,10 +258,10 @@ |
||
| 258 | 258 | unset($dat['dq']); |
| 259 | 259 | } |
| 260 | 260 | } |
| 261 | - if(empty($dat['q'])) { |
|
| 261 | + if (empty($dat['q'])) { |
|
| 262 | 262 | unset($dat['q']); |
| 263 | 263 | } |
| 264 | - if(empty($dat['dq'])) { |
|
| 264 | + if (empty($dat['dq'])) { |
|
| 265 | 265 | unset($dat['dq']); |
| 266 | 266 | } |
| 267 | 267 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | { |
| 145 | 145 | // todo verify/useless ? |
| 146 | 146 | if (is_int($name)) { |
| 147 | - $name = (string)$name; |
|
| 147 | + $name = (string) $name; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | // that parameter exists in template ? |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | } catch (Throwable $e) { |
| 268 | 268 | unset($e); |
| 269 | 269 | // hack : 1 => "ouvrage collectif" |
| 270 | - $name = (string)$name; |
|
| 270 | + $name = (string) $name; |
|
| 271 | 271 | $this->log[] = "parameter $name not found"; |
| 272 | 272 | if (!$noError) { |
| 273 | 273 | $this->parametersErrorFromHydrate[$name] = $value; |
@@ -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 | ); |
@@ -106,8 +106,8 @@ discard block |
||
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | // translation : "London"->"Londres" seulement si langue=fr |
| 109 | - if($this->hasParamValue('langue') |
|
| 110 | - && $this->getParam('langue') === self::WIKI_LANGUAGE ) { |
|
| 109 | + if ($this->hasParamValue('langue') |
|
| 110 | + && $this->getParam('langue') === self::WIKI_LANGUAGE) { |
|
| 111 | 111 | $manager = new FileManager(); |
| 112 | 112 | $row = $manager->findCSVline(__DIR__.'/resources/traduction_ville.csv', $location); |
| 113 | 113 | if (!empty($row) && !empty($row[1])) { |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | if (count($res) >= 2 && empty($auteur2)) { |
| 193 | 193 | // delete author-params |
| 194 | 194 | array_map( |
| 195 | - function ($param) { |
|
| 195 | + function($param) { |
|
| 196 | 196 | $this->unsetParam($param); |
| 197 | 197 | }, |
| 198 | 198 | ['auteur', 'auteurs', 'prénom1', 'nom1'] |
@@ -732,7 +732,7 @@ discard block |
||
| 732 | 732 | // todo bug {{citation bloc}} si "=" ou "|" dans texte de citation |
| 733 | 733 | // Legacy : use {{début citation}} ... {{fin citation}} |
| 734 | 734 | if (preg_match('#[=|]#', $extrait) > 0) { |
| 735 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
| 735 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
| 736 | 736 | 'template' => 'début citation', |
| 737 | 737 | '1' => '', |
| 738 | 738 | 'raw' => '{{Début citation}}'.$extrait.'{{Fin citation}}', |
@@ -741,7 +741,7 @@ discard block |
||
| 741 | 741 | $this->notCosmetic = true; |
| 742 | 742 | } else { |
| 743 | 743 | // StdClass |
| 744 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
| 744 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
| 745 | 745 | 'template' => 'citation bloc', |
| 746 | 746 | '1' => $extrait, |
| 747 | 747 | 'raw' => '{{Citation bloc|'.$extrait.'}}', |
@@ -757,7 +757,7 @@ discard block |
||
| 757 | 757 | // "commentaire=bla" => {{Commentaire biblio|1=bla}} |
| 758 | 758 | if ($this->hasParamValue('commentaire')) { |
| 759 | 759 | $commentaire = $this->getParam('commentaire'); |
| 760 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
| 760 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
| 761 | 761 | 'template' => 'commentaire biblio', |
| 762 | 762 | '1' => $commentaire, |
| 763 | 763 | 'raw' => '{{Commentaire biblio|'.$commentaire.'}}', |
@@ -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 | |