@@ -74,7 +74,7 @@ |
||
74 | 74 | return null; |
75 | 75 | } |
76 | 76 | |
77 | - $nbResults = (int)$xml->xpath('//srw:numberOfRecords[1]')[0] ?? 0; |
|
77 | + $nbResults = (int) $xml->xpath('//srw:numberOfRecords[1]')[0] ?? 0; |
|
78 | 78 | |
79 | 79 | if (0 === $nbResults) { |
80 | 80 | return null; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $editInfo = new EditInfo(static::BOT_TALK_SUMMARY); |
54 | 54 | $success = $page->addToBottomOfThePage($addText, $editInfo); |
55 | 55 | |
56 | - return (bool)$success; |
|
56 | + return (bool) $success; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | { |
68 | 68 | $to = ($toEditor) ? sprintf('@%s : ', $toEditor) : ''; // {{notif}} |
69 | 69 | $sentence = TextUtil::mb_ucfirst($this->getRandomSentence()); |
70 | - if(!$sentence){ |
|
70 | + if (!$sentence) { |
|
71 | 71 | throw new \Exception('no sentence'); |
72 | 72 | } |
73 | 73 | $addText = sprintf('%s%s%s --~~~~', $identation, $to, $sentence); |
@@ -78,10 +78,10 @@ discard block |
||
78 | 78 | private function getRandomSentence(): ?string |
79 | 79 | { |
80 | 80 | $sentences = file(self::BOT_TALK_FILE); |
81 | - if(!$sentences){ |
|
81 | + if (!$sentences) { |
|
82 | 82 | return null; |
83 | 83 | } |
84 | - return (string)trim($sentences[array_rand($sentences)]); |
|
84 | + return (string) trim($sentences[array_rand($sentences)]); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | public function getRedirect(): ?string |
96 | 96 | { |
97 | 97 | if (preg_match('/^#REDIRECT(?:ION)? ?\[\[([^]]+)]]/i', $this->getText(), $matches)) { |
98 | - return (string)trim($matches[1]); |
|
98 | + return (string) trim($matches[1]); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | return null; |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | $parser = new TagParser(); // todo ParserFactory |
228 | 228 | $refs = $parser->importHtml($text)->getRefValues(); // [] |
229 | 229 | |
230 | - return (array)$refs; |
|
230 | + return (array) $refs; |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | /** |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | 'titre' => $volume->title, |
41 | 41 | 'sous-titre' => $this->filterSubtitle($volume), |
42 | 42 | 'année' => $this->convertDate2Year($volume->publishedDate), |
43 | - 'pages totales' => (string)$volume->pageCount ?? null, |
|
43 | + 'pages totales' => (string) $volume->pageCount ?? null, |
|
44 | 44 | 'isbn' => $this->convertIsbn($volume), |
45 | 45 | 'présentation en ligne' => $this->presentationEnLigne($volume), |
46 | 46 | 'lire en ligne' => $this->lireEnLigne($volume), |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | return null; |
74 | 74 | } |
75 | 75 | if (preg_match('/[^0-9]?([12][0-9]{3})[^0-9]?/', $data, $matches) > 0) { |
76 | - return (string)$matches[1]; |
|
76 | + return (string) $matches[1]; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | return null; |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | // so isbn-13 replace isbn-10 |
93 | 93 | // todo refac algo (if 2x isbn13?) |
94 | 94 | $isbn = null; |
95 | - $ids = (array)$volume->industryIdentifiers; |
|
95 | + $ids = (array) $volume->industryIdentifiers; |
|
96 | 96 | foreach ($ids as $id) { |
97 | 97 | if (!isset($isbn) && in_array($id->type, ['ISBN_10', 'ISBN_13'])) { |
98 | 98 | $isbn = $id->identifier; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | { |
91 | 91 | $element = $this->xml->xpath($path); |
92 | 92 | if (isset($element[0]) && $element[0] instanceof SimpleXMLElement) { |
93 | - return (string)$element[0]; |
|
93 | + return (string) $element[0]; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | return null; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | { |
107 | 107 | $raw = $this->xpath2string('//mxc:datafield[@tag="215"]/mxc:subfield[@code="a"]'); |
108 | 108 | if (!empty($raw) && preg_match('#([0-9]{2,}) p\.#', $raw, $matches) > 0) { |
109 | - return (string)$matches[1]; |
|
109 | + return (string) $matches[1]; |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | return null; |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | $raw = $this->xpath2string('//srw:recordIdentifier[1]/text()'); |
191 | 191 | |
192 | 192 | if ($raw && preg_match('#ark:/[0-9]+/cb([0-9]+)#', $raw, $matches) > 0) { |
193 | - return (string)$matches[1]; |
|
193 | + return (string) $matches[1]; |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | return null; |