@@ -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 | } |
@@ -23,9 +23,9 @@ |
||
| 23 | 23 | if (200 !== $response->getStatusCode()) { |
| 24 | 24 | die('not 200 response'); |
| 25 | 25 | } |
| 26 | -try{ |
|
| 26 | +try { |
|
| 27 | 27 | $newText = $response->getBody()->getContents(); |
| 28 | -}catch (Throwable $e){ |
|
| 28 | +} catch (Throwable $e) { |
|
| 29 | 29 | dump($e); |
| 30 | 30 | die; |
| 31 | 31 | } |
@@ -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) { |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | [ |
| 95 | 95 | 'page' => $title ?? '', |
| 96 | 96 | 'verify' => date("Y-m-d H:i:s"), |
| 97 | - 'altered' => (int)$stat, |
|
| 97 | + 'altered' => (int) $stat, |
|
| 98 | 98 | ] |
| 99 | 99 | ); |
| 100 | 100 | } |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - return (int)round(($count - $found) / count($data) * 100); |
|
| 152 | + return (int) round(($count - $found) / count($data) * 100); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | } |
@@ -40,10 +40,10 @@ |
||
| 40 | 40 | $db = new Mysql($pdo); |
| 41 | 41 | |
| 42 | 42 | $monitor = $db->fetchRow('select count(id) from page_ouvrages where optidate is not null'); |
| 43 | -$number = (int)$monitor['count(id)']; |
|
| 43 | +$number = (int) $monitor['count(id)']; |
|
| 44 | 44 | |
| 45 | 45 | $monitor = $db->fetchRow('select count(distinct page) as pages from page_ouvrages where optidate is not null and isbn<>""'); |
| 46 | -$pageNb = (int)$monitor['pages']; |
|
| 46 | +$pageNb = (int) $monitor['pages']; |
|
| 47 | 47 | |
| 48 | 48 | $newText = <<<EOF |
| 49 | 49 | <div style="background:#EBF6E9;border:2px solid grey;padding:10px;border-radius:10px;"> |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | |
| 24 | 24 | public function hasWarning(): bool |
| 25 | 25 | { |
| 26 | - return (bool)$this->warning; |
|
| 26 | + return (bool) $this->warning; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /** |
@@ -111,7 +111,7 @@ |
||
| 111 | 111 | $data[] = ['title' => $title, 'template' => $template]; |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - return (array)$data; |
|
| 114 | + return (array) $data; |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | /** |
@@ -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 | } |