@@ -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 | |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | if (count($res) >= 2 && empty($auteur2)) { |
| 188 | 188 | // delete author-params |
| 189 | 189 | array_map( |
| 190 | - function ($param) { |
|
| 190 | + function($param) { |
|
| 191 | 191 | $this->unsetParam($param); |
| 192 | 192 | }, |
| 193 | 193 | ['auteur', 'auteurs', 'prénom1', 'nom1'] |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | $goo = GoogleLivresTemplate::simplifyGoogleUrl($url); |
| 440 | - if (!empty($goo) && $goo !== $url ) { |
|
| 440 | + if (!empty($goo) && $goo !== $url) { |
|
| 441 | 441 | $this->setParam($param, $goo); |
| 442 | 442 | $this->log('Google'); |
| 443 | 443 | $this->notCosmetic = true; |
@@ -685,7 +685,7 @@ discard block |
||
| 685 | 685 | // todo detect duplication ouvrage/plume dans externalTemplate ? |
| 686 | 686 | if (!empty($this->getParam('plume'))) { |
| 687 | 687 | $plumeValue = $this->getParam('plume'); |
| 688 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
| 688 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
| 689 | 689 | 'template' => 'plume', |
| 690 | 690 | '1' => $plumeValue, |
| 691 | 691 | 'raw' => '{{nobr|. {{plume}}}}', |
@@ -700,7 +700,7 @@ discard block |
||
| 700 | 700 | // todo bug {{citation bloc}} si "=" ou "|" dans texte de citation |
| 701 | 701 | // Legacy : use {{début citation}} ... {{fin citation}} |
| 702 | 702 | if (preg_match('#[=|]#', $extrait) > 0) { |
| 703 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
| 703 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
| 704 | 704 | 'template' => 'début citation', |
| 705 | 705 | '1' => '', |
| 706 | 706 | 'raw' => '{{début citation}}'.$extrait.'{{fin citation}}', |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | $this->notCosmetic = true; |
| 710 | 710 | } else { |
| 711 | 711 | // StdClass |
| 712 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
| 712 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
| 713 | 713 | 'template' => 'citation bloc', |
| 714 | 714 | '1' => $extrait, |
| 715 | 715 | 'raw' => '{{extrait|'.$extrait.'}}', |
@@ -725,7 +725,7 @@ discard block |
||
| 725 | 725 | // "commentaire=bla" => {{Commentaire biblio|1=bla}} |
| 726 | 726 | if (!empty($this->getParam('commentaire'))) { |
| 727 | 727 | $commentaire = $this->getParam('commentaire'); |
| 728 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
| 728 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
| 729 | 729 | 'template' => 'commentaire biblio', |
| 730 | 730 | '1' => $commentaire, |
| 731 | 731 | 'raw' => '{{commentaire biblio|'.$commentaire.'}}', |
@@ -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 { |