Completed
Push — master ( d0b90b...a19dc4 )
by Dispositif
15:41
created
src/Application/Examples/botstats.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -32,25 +32,25 @@  discard block
 block discarded – undo
32 32
 $data = [];
33 33
 
34 34
 $monitor = $db->fetchRow('select count(id) from temprawopti 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 temprawopti 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 temprawopti 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 temprawopti 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 temprawopti 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 temprawopti 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 temprawopti 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 TempRawOpti A
56 56
                 WHERE notcosmetic=1.
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
83 83
             "<tr><td>%s &#37;</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
         );
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 wiki;
123 123
 
124 124
 $wikiText = str_replace('#monitor#', $monitWiki, $wikiText);
125
-foreach($data as $key => $dat){
125
+foreach ($data as $key => $dat) {
126 126
     $wikiText = str_replace('#'.$key.'#', $dat, $wikiText);
127 127
 }
128 128
 
Please login to merge, or discard this patch.
src/Application/Examples/cleanErrorReport.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,12 +26,12 @@  discard block
 block discarded – undo
26 26
 
27 27
 $wiki = ServiceFactory::wikiApi();
28 28
 $pages = $wiki->newPageListGetter()->getPageListFromCategoryName('Catégorie:Signalement_'.$botName);
29
-if(!$pages) {
29
+if (!$pages) {
30 30
     throw new \Exception("rien trouvé dans catégorie");
31 31
 }
32 32
 $pages = $pages->toArray();
33 33
 $res = [];
34
-foreach ($pages as $page){
34
+foreach ($pages as $page) {
35 35
     /**
36 36
      * @var $page Page
37 37
      */
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 $talkTitles = file($filename);
49 49
 
50 50
 foreach ($talkTitles as $talkTitle) {
51
-    $talkTitle = str_replace('Talk:','Discussion:', $talkTitle);
51
+    $talkTitle = str_replace('Talk:', 'Discussion:', $talkTitle);
52 52
     sleep(10);
53 53
     echo "$talkTitle \n";
54 54
 
Please login to merge, or discard this patch.
src/Application/ErrorReport.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
      *
55 55
      * @return string
56 56
      */
57
-    public function deleteAllReports(string $text, ?string $botName='ZiziBot'): string
57
+    public function deleteAllReports(string $text, ?string $botName = 'ZiziBot'): string
58 58
     {
59 59
         $pattern = sprintf(
60 60
             '#== Ouvrage avec erreur de paramètre ==(.*)Le robot \[\[Utilisateur:%s\|%s\]\] \(\[\[Discussion utilisateur:%s\|discuter\]\]\) [0-9a-zéà: ]+ \(CET\)[\n]*#s',
Please login to merge, or discard this patch.