@@ -53,7 +53,7 @@ |
||
53 | 53 | ['{{Ouvrage |
54 | 54 | | langue=fr |
55 | 55 | }}', |
56 | - "\n | ", |
|
56 | + "\n | ", |
|
57 | 57 | ], |
58 | 58 | ]; |
59 | 59 | } |
@@ -76,7 +76,7 @@ |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | // note : multi-records filtered in BnFMapper |
79 | - $nbResults = (int)$xml->xpath('//srw:numberOfRecords[1]')[0] ?? 0; |
|
79 | + $nbResults = (int) $xml->xpath('//srw:numberOfRecords[1]')[0] ?? 0; |
|
80 | 80 | if (0 === $nbResults) { |
81 | 81 | return null; |
82 | 82 | } |
@@ -60,14 +60,14 @@ |
||
60 | 60 | */ |
61 | 61 | $data = $this->mapping($volume); |
62 | 62 | |
63 | - if(isset($data['infos'])) { |
|
63 | + if (isset($data['infos'])) { |
|
64 | 64 | $infos = $data['infos']; |
65 | 65 | unset($data['infos']); |
66 | 66 | } |
67 | 67 | |
68 | 68 | try { |
69 | 69 | $this->ouvrage->hydrate($data); |
70 | - if(isset($infos)) { |
|
70 | + if (isset($infos)) { |
|
71 | 71 | $this->ouvrage->setInfos($infos); |
72 | 72 | } |
73 | 73 | } catch (Throwable $e) { |
@@ -41,7 +41,7 @@ |
||
41 | 41 | $res = $this->searchByISNI($infos['ISNIAuteur1']); |
42 | 42 | } |
43 | 43 | if (isset($infos['isbn'])) { |
44 | - if(!empty($res)) { |
|
44 | + if (!empty($res)) { |
|
45 | 45 | sleep(2); |
46 | 46 | } |
47 | 47 | $res = array_merge($res ?? [], $this->findArticleByISBN13($infos['isbn'])); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $result[$tplName][$inc] += ['model' => $tplObject]; |
70 | 70 | } |
71 | 71 | |
72 | - return (array)$result; |
|
72 | + return (array) $result; |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | ) { |
189 | 189 | array_walk( |
190 | 190 | $matches, |
191 | - function (&$value) { |
|
191 | + function(&$value) { |
|
192 | 192 | $value = str_replace(['CURLYBRACKETO', 'CURLYBRACKETC'], ['{', '}'], $value); |
193 | 193 | } |
194 | 194 | ); |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | } |
249 | 249 | // No param name => take $keyNum as param name |
250 | 250 | if (false === $pos) { |
251 | - $param = (string)$keyNum; |
|
251 | + $param = (string) $keyNum; |
|
252 | 252 | $value = $line; |
253 | 253 | ++$keyNum; |
254 | 254 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | $channel->basic_qos(null, 1, null); |
37 | 37 | // callback to $this->msgProcess(). |
38 | 38 | // TODO check Rector refac |
39 | - $channel->basic_consume(static::QUEUE_NAME, '', false, false, false, false, function (\PhpAmqpLib\Message\AMQPMessage $msg) : void { |
|
39 | + $channel->basic_consume(static::QUEUE_NAME, '', false, false, false, false, function(\PhpAmqpLib\Message\AMQPMessage $msg) : void { |
|
40 | 40 | $this->msgProcess($msg); |
41 | 41 | }); |
42 | 42 |
@@ -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 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $res = []; |
127 | 127 | foreach ($elements as $element) { |
128 | 128 | if (isset($element) && $element instanceof SimpleXMLElement) { |
129 | - $res[] = (string)$element; |
|
129 | + $res[] = (string) $element; |
|
130 | 130 | } |
131 | 131 | } |
132 | 132 | |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | { |
195 | 195 | $raw = $this->xpath2string('//mxc:datafield[@tag="215"]/mxc:subfield[@code="a"]'); |
196 | 196 | if (!empty($raw) && preg_match('#(\d{2,}) p\.#', $raw, $matches) > 0) { |
197 | - return (string)$matches[1]; |
|
197 | + return (string) $matches[1]; |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | return null; |
@@ -59,7 +59,7 @@ |
||
59 | 59 | { |
60 | 60 | // Style "auto1234" |
61 | 61 | if (empty($this->getParam('périodique') || empty($this->getParam('date')))) { |
62 | - return 'auto'.(string)random_int(1000, 9999); |
|
62 | + return 'auto'.(string) random_int(1000, 9999); |
|
63 | 63 | } |
64 | 64 | // Style "LeMonde15022017" |
65 | 65 | $periodique = str_replace( |
@@ -51,7 +51,7 @@ |
||
51 | 51 | $id .= ($this->getParam('nom'.$i)) ?? $this->getParam('auteur'.$i) ?? ''; |
52 | 52 | } |
53 | 53 | |
54 | - return $id . ($this->getParam('année') ?? ''); |
|
54 | + return $id.($this->getParam('année') ?? ''); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | } |