@@ -34,11 +34,11 @@ |
||
34 | 34 | |
35 | 35 | // {{Google Livres|= |
36 | 36 | // {{Google Livres|https://books.google.fr/books?id= |
37 | - $newText = str_replace('{{Google Livres|https://books.google.fr/books?id=','{{Google Livres|id=',$text); |
|
37 | + $newText = str_replace('{{Google Livres|https://books.google.fr/books?id=', '{{Google Livres|id=', $text); |
|
38 | 38 | |
39 | 39 | sleep(7); |
40 | 40 | |
41 | - if($newText === $text) { |
|
41 | + if ($newText === $text) { |
|
42 | 42 | echo "Skip identique\n"; |
43 | 43 | continue; |
44 | 44 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | public function getRedirect(): ?string |
124 | 124 | { |
125 | 125 | if ($this->getText() && preg_match('/^#REDIRECT(?:ION)? ?\[\[([^]]+)]]/i', $this->getText(), $matches)) { |
126 | - return (string)trim($matches[1]); |
|
126 | + return (string) trim($matches[1]); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | return null; |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | $parser = new TagParser(); // todo ParserFactory |
302 | 302 | $refs = $parser->importHtml($text)->getRefValues(); // [] |
303 | 303 | |
304 | - return (array)$refs; |
|
304 | + return (array) $refs; |
|
305 | 305 | } |
306 | 306 | |
307 | 307 | /** |
@@ -414,7 +414,7 @@ |
||
414 | 414 | if (is_int($param)) { |
415 | 415 | |
416 | 416 | // erreur "|lire en ligne|" |
417 | - if(in_array($value, $this->getParamsAndAlias())){ |
|
417 | + if (in_array($value, $this->getParamsAndAlias())) { |
|
418 | 418 | unset($errorUserData[$param]); |
419 | 419 | continue; |
420 | 420 | } |
@@ -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"]', ', '), |
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; |
@@ -136,8 +136,7 @@ |
||
136 | 136 | |
137 | 137 | private function onlineIsbnSearch(string $isbn, ?string $isbn10 = null) |
138 | 138 | { |
139 | - online: |
|
140 | - echo "sleep 10...\n"; |
|
139 | + online : echo "sleep 10...\n"; |
|
141 | 140 | sleep(10); |
142 | 141 | |
143 | 142 | try { |