@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | // PUNCTUATION conversion |
| 53 | 53 | $punctuationColl = array_filter( |
| 54 | 54 | TextUtil::ALL_PUNCTUATION, |
| 55 | - function ($value) { |
|
| 55 | + function($value) { |
|
| 56 | 56 | // skip punctuation chars from mixed names (example : "Pierre-Marie L'Anglois") |
| 57 | 57 | return !in_array($value, ["'", '-', '-']); |
| 58 | 58 | } |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | $modText = preg_replace_callback_array( |
| 125 | 125 | [ |
| 126 | 126 | // URL |
| 127 | - '#\bhttps?://[^ \]]+#i' => function ($match) { |
|
| 127 | + '#\bhttps?://[^ \]]+#i' => function($match) { |
|
| 128 | 128 | // '#https?\:\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+\#]*[\w\-\@?^=%&/~\+#])?#' |
| 129 | 129 | $this->tokenValue['URL'][] = $match[0]; |
| 130 | 130 | |
@@ -132,26 +132,26 @@ discard block |
||
| 132 | 132 | }, |
| 133 | 133 | // BIBABREV : "dir.", "trad.", "(dir.)", "[dir.]", etc. |
| 134 | 134 | // TODO: regex flaw : "(" not evaluated in BIBABREV. Example : "(dir.)" |
| 135 | - '#\b[(\[]?(collectif|coll\.|dir\.|trad\.|coord\.|ill\.)[)\]]?#i' => function ($match) { |
|
| 135 | + '#\b[(\[]?(collectif|coll\.|dir\.|trad\.|coord\.|ill\.)[)\]]?#i' => function($match) { |
|
| 136 | 136 | $this->tokenValue['BIBABREV'][] = $match[0]; // [1] = dir |
| 137 | 137 | |
| 138 | 138 | return ' BIBABREV '; |
| 139 | 139 | }, |
| 140 | 140 | // AND |
| 141 | - '# (et|and|&|with|avec|e) #' => function ($match) { |
|
| 141 | + '# (et|and|&|with|avec|e) #' => function($match) { |
|
| 142 | 142 | $this->tokenValue['AND'][] = $match[1]; |
| 143 | 143 | |
| 144 | 144 | return ' AND '; |
| 145 | 145 | }, |
| 146 | 146 | // COMMA |
| 147 | - '#,#' => function () { |
|
| 147 | + '#,#' => function() { |
|
| 148 | 148 | return ' COMMA '; |
| 149 | 149 | }, |
| 150 | 150 | // INITIAL : 2) convert letter ("A.") or junior ("Jr.") or senior ("Sr.") |
| 151 | 151 | // extract initial before "." converted in PUNCTUATION |
| 152 | 152 | // Note : \b word boundary match between "L" and "'Amour" in "L'Amour" (for [A-Z]\b) |
| 153 | 153 | // \b([A-Z]\. |[A-Z] |JR|Jr\.|Jr\b|Sr\.|Sr\b)+ for grouping "A. B." in same INITIAL ? |
| 154 | - "#\b([A-Z]\.|[A-Z] |JR|Jr\.|Jr\b|Sr\.|Sr\b)#" => function ($match) { |
|
| 154 | + "#\b([A-Z]\.|[A-Z] |JR|Jr\.|Jr\b|Sr\.|Sr\b)#" => function($match) { |
|
| 155 | 155 | $this->tokenValue['INITIAL'][] = $match[0]; |
| 156 | 156 | |
| 157 | 157 | return ' INITIAL '; |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | const MODEL_NAME = 'lien web'; |
| 20 | 20 | |
| 21 | 21 | const REQUIRED_PARAMETERS |
| 22 | - = [ |
|
| 22 | + = [ |
|
| 23 | 23 | // 'langue' => '', // suggéré |
| 24 | 24 | // 'auteur1' => '', // suggéré |
| 25 | 25 | 'titre' => '', // required |
@@ -326,7 +326,7 @@ |
||
| 326 | 326 | $string .= $paramValue; |
| 327 | 327 | } |
| 328 | 328 | // expanded model -> "\n}}" |
| 329 | - if($this->userSeparator && strpos($this->userSeparator,"\n") !== false ) { |
|
| 329 | + if ($this->userSeparator && strpos($this->userSeparator, "\n") !== false) { |
|
| 330 | 330 | $string .= "\n"; |
| 331 | 331 | } |
| 332 | 332 | $string .= '}}'; |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | if (count($res) >= 2 && empty($auteur2)) { |
| 162 | 162 | // delete author-params |
| 163 | 163 | array_map( |
| 164 | - function ($param) { |
|
| 164 | + function($param) { |
|
| 165 | 165 | $this->unsetParam($param); |
| 166 | 166 | }, |
| 167 | 167 | ['auteur', 'auteurs', 'prénom1', 'nom1'] |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | // todo detect duplication ouvrage/plume dans externalTemplate ? |
| 577 | 577 | if (!empty($this->getParam('plume'))) { |
| 578 | 578 | $plumeValue = $this->getParam('plume'); |
| 579 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
| 579 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
| 580 | 580 | 'template' => 'plume', |
| 581 | 581 | '1' => $plumeValue, |
| 582 | 582 | 'raw' => '{{nobr|. {{plume}}}}', |
@@ -591,7 +591,7 @@ discard block |
||
| 591 | 591 | // todo bug {{citation bloc}} si "=" ou "|" dans texte de citation |
| 592 | 592 | // Legacy : use {{début citation}} ... {{fin citation}} |
| 593 | 593 | if (preg_match('#[=|]#', $extrait) > 0) { |
| 594 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
| 594 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
| 595 | 595 | 'template' => 'début citation', |
| 596 | 596 | '1' => '', |
| 597 | 597 | 'raw' => '{{début citation}}'.$extrait.'{{fin citation}}', |
@@ -599,7 +599,7 @@ discard block |
||
| 599 | 599 | $this->log('{début citation}'); |
| 600 | 600 | } else { |
| 601 | 601 | // StdClass |
| 602 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
| 602 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
| 603 | 603 | 'template' => 'citation bloc', |
| 604 | 604 | '1' => $extrait, |
| 605 | 605 | 'raw' => '{{extrait|'.$extrait.'}}', |
@@ -613,7 +613,7 @@ discard block |
||
| 613 | 613 | // "commentaire=bla" => {{Commentaire biblio|1=bla}} |
| 614 | 614 | if (!empty($this->getParam('commentaire'))) { |
| 615 | 615 | $commentaire = $this->getParam('commentaire'); |
| 616 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
| 616 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
| 617 | 617 | 'template' => 'commentaire biblio', |
| 618 | 618 | '1' => $commentaire, |
| 619 | 619 | 'raw' => '{{commentaire biblio|'.$commentaire.'}}', |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | return null; |
| 88 | 88 | } |
| 89 | 89 | if (preg_match('/[^0-9]?([12][0-9]{3})[^0-9]?/', $details['publish_date'], $matches) > 0) { |
| 90 | - return (string)$matches[1]; |
|
| 90 | + return (string) $matches[1]; |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | return null; |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | { |
| 90 | 90 | $element = $this->xml->xpath($path); |
| 91 | 91 | if (isset($element[0]) && $element[0] instanceof SimpleXMLElement) { |
| 92 | - return (string)$element[0]; |
|
| 92 | + return (string) $element[0]; |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | return null; |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | $raw = $this->xpath2string('//srw:recordIdentifier[1]/text()'); |
| 177 | 177 | |
| 178 | 178 | if ($raw && preg_match('#ark:/[0-9]+/cb([0-9]+)#', $raw, $matches) > 0) { |
| 179 | - return (string)$matches[1]; |
|
| 179 | + return (string) $matches[1]; |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | return null; |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | public function deleteEmptyValueArray(array $myArray): array |
| 22 | 22 | { |
| 23 | - return array_filter($myArray, function ($value) { |
|
| 23 | + return array_filter($myArray, function($value) { |
|
| 24 | 24 | return !is_null($value) && '' !== $value; |
| 25 | 25 | }); |
| 26 | 26 | } |
@@ -185,7 +185,7 @@ |
||
| 185 | 185 | ) { |
| 186 | 186 | array_walk( |
| 187 | 187 | $matches, |
| 188 | - function (&$value) { |
|
| 188 | + function(&$value) { |
|
| 189 | 189 | $value = str_replace(['CURLYBRACKETO', 'CURLYBRACKETC'], ['{', '}'], $value); |
| 190 | 190 | } |
| 191 | 191 | ); |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | ['{{Ouvrage |
| 54 | 54 | | langue=fr |
| 55 | 55 | }}', |
| 56 | - "\n | ", |
|
| 56 | + "\n | ", |
|
| 57 | 57 | ], |
| 58 | 58 | ]; |
| 59 | 59 | } |