@@ -122,7 +122,7 @@ |
||
| 122 | 122 | $this->googleBookProcess(); |
| 123 | 123 | $this->processSousTitre(); |
| 124 | 124 | |
| 125 | - if($this->notCosmetic && 'BnF' === $this->book->getSource()){ |
|
| 125 | + if ($this->notCosmetic && 'BnF' === $this->book->getSource()) { |
|
| 126 | 126 | $this->log('(BnF)'); |
| 127 | 127 | } |
| 128 | 128 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $this->xml = $xml; |
| 41 | 41 | |
| 42 | 42 | // skip multi-records |
| 43 | - $nbResults = (int)$xml->xpath('//srw:numberOfRecords[1]')[0] ?? 0; |
|
| 43 | + $nbResults = (int) $xml->xpath('//srw:numberOfRecords[1]')[0] ?? 0; |
|
| 44 | 44 | if (1 !== $nbResults) { |
| 45 | 45 | echo "BNF : $nbResults records (skip)\n"; |
| 46 | 46 | |
@@ -74,9 +74,9 @@ discard block |
||
| 74 | 74 | // e : Complément du titre |
| 75 | 75 | 'sous-titre' => $this->xpath2string('//mxc:datafield[@tag="200"]/mxc:subfield[@code="e"][1]', ', '), |
| 76 | 76 | // f : responsabilité principale "Pierre Durand, Paul Dupond" (XML de dingue pour ça...) |
| 77 | - 'auteur1' => $this->xpath2string('//mxc:datafield[@tag="200"]/mxc:subfield[@code="f"]', ', '), |
|
| 77 | + 'auteur1' => $this->xpath2string('//mxc:datafield[@tag="200"]/mxc:subfield[@code="f"]', ', '), |
|
| 78 | 78 | // g : Mention de responsabilité suivante |
| 79 | - 'auteur2' => $this->xpath2string('//mxc:datafield[@tag="200"]/mxc:subfield[@code="g"]', ', '), |
|
| 79 | + 'auteur2' => $this->xpath2string('//mxc:datafield[@tag="200"]/mxc:subfield[@code="g"]', ', '), |
|
| 80 | 80 | // h : Numéro de partie |
| 81 | 81 | // 'volume' => $this->xpath2string('//mxc:datafield[@tag="200"]/mxc:subfield[@code="h"]'), |
| 82 | 82 | // i : Titre de partie |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | $res = []; |
| 106 | 106 | foreach ($elements as $element) { |
| 107 | 107 | if (isset($element) && $element instanceof SimpleXMLElement) { |
| 108 | - $res[] = (string)$element; |
|
| 108 | + $res[] = (string) $element; |
|
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | { |
| 127 | 127 | $raw = $this->xpath2string('//mxc:datafield[@tag="215"]/mxc:subfield[@code="a"]'); |
| 128 | 128 | if (!empty($raw) && preg_match('#([0-9]{2,}) p\.#', $raw, $matches) > 0) { |
| 129 | - return (string)$matches[1]; |
|
| 129 | + return (string) $matches[1]; |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | return null; |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | $raw = $this->xpath2string('//srw:recordIdentifier[1]/text()'); |
| 207 | 207 | |
| 208 | 208 | if ($raw && preg_match('#ark:/[0-9]+/cb([0-9]+)#', $raw, $matches) > 0) { |
| 209 | - return (string)$matches[1]; |
|
| 209 | + return (string) $matches[1]; |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | return null; |
@@ -32,25 +32,25 @@ discard block |
||
| 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 |
||
| 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 | ); |
@@ -122,7 +122,7 @@ discard block |
||
| 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 | |