@@ -18,7 +18,7 @@ |
||
18 | 18 | |
19 | 19 | class LocationHandler extends AbstractOuvrageHandler |
20 | 20 | { |
21 | - public const TRANSLATE_CITY_FR = __DIR__ . '/../../resources/traduction_ville.csv'; |
|
21 | + public const TRANSLATE_CITY_FR = __DIR__.'/../../resources/traduction_ville.csv'; |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * @var PageListInterface |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | } |
93 | 93 | if (preg_match('#^\[(http[^ \]]+) ([^]]+)]#i', $this->ouvrage->getParam($param), $matches) > 0) { |
94 | 94 | $this->ouvrage->setParam($param, str_replace($matches[0], $matches[2], $this->ouvrage->getParam($param))); |
95 | - $this->optiStatus->addSummaryLog('±' . $param); |
|
95 | + $this->optiStatus->addSummaryLog('±'.$param); |
|
96 | 96 | |
97 | 97 | if (in_array($param, ['titre', 'titre chapitre'])) { |
98 | 98 | if (empty($this->ouvrage->getParam('lire en ligne'))) { |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | |
102 | 102 | return; |
103 | 103 | } |
104 | - $this->optiStatus->addSummaryLog('autre lien externe: ' . $matches[1]); |
|
104 | + $this->optiStatus->addSummaryLog('autre lien externe: '.$matches[1]); |
|
105 | 105 | } |
106 | 106 | } |
107 | 107 | } |
@@ -126,11 +126,11 @@ |
||
126 | 126 | { |
127 | 127 | $annee = $this->getParam('année'); |
128 | 128 | if (!empty($annee) && is_numeric($annee)) { |
129 | - return (int)$annee; |
|
129 | + return (int) $annee; |
|
130 | 130 | } |
131 | 131 | $date = $this->getParam('date'); |
132 | 132 | if ($date && preg_match('#[^0-9]?([12]\d\d\d)[^0-9]?#', $date, $matches) > 0) { |
133 | - return (int)$matches[1]; |
|
133 | + return (int) $matches[1]; |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | return null; |
@@ -29,19 +29,19 @@ discard block |
||
29 | 29 | // todo bug {{citation bloc}} si "=" ou "|" dans texte de citation |
30 | 30 | // Legacy : use {{début citation}} ... {{fin citation}} |
31 | 31 | if (preg_match('#[=|]#', $extrait) > 0) { |
32 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
32 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
33 | 33 | 'template' => 'début citation', |
34 | 34 | '1' => '', |
35 | - 'raw' => '{{Début citation}}' . $extrait . '{{Fin citation}}', |
|
35 | + 'raw' => '{{Début citation}}'.$extrait.'{{Fin citation}}', |
|
36 | 36 | ]; |
37 | 37 | $this->addSummaryLog('{Début citation}'); |
38 | 38 | $this->optiStatus->setNotCosmetic(true); |
39 | 39 | } else { |
40 | 40 | // StdClass |
41 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
41 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
42 | 42 | 'template' => 'citation bloc', |
43 | 43 | '1' => $extrait, |
44 | - 'raw' => '{{Citation bloc|' . $extrait . '}}', |
|
44 | + 'raw' => '{{Citation bloc|'.$extrait.'}}', |
|
45 | 45 | ]; |
46 | 46 | $this->addSummaryLog('{Citation bloc}'); |
47 | 47 | $this->optiStatus->setNotCosmetic(true); |
@@ -54,10 +54,10 @@ discard block |
||
54 | 54 | // "commentaire=bla" => {{Commentaire biblio|1=bla}} |
55 | 55 | if ($this->hasParamValue('commentaire')) { |
56 | 56 | $commentaire = $this->getParam('commentaire'); |
57 | - $this->ouvrage->externalTemplates[] = (object)[ |
|
57 | + $this->ouvrage->externalTemplates[] = (object) [ |
|
58 | 58 | 'template' => 'commentaire biblio', |
59 | 59 | '1' => $commentaire, |
60 | - 'raw' => '{{Commentaire biblio|' . $commentaire . '}}', |
|
60 | + 'raw' => '{{Commentaire biblio|'.$commentaire.'}}', |
|
61 | 61 | ]; |
62 | 62 | $this->unsetParam('commentaire'); |
63 | 63 | $this->addSummaryLog('{commentaire}'); |
@@ -23,7 +23,7 @@ |
||
23 | 23 | foreach ($params as $param) { |
24 | 24 | if ( |
25 | 25 | $this->ouvrage->hasParamValue($param) |
26 | - && WikiTextUtil::isWikify(' ' . $this->ouvrage->getParam($param)) |
|
26 | + && WikiTextUtil::isWikify(' '.$this->ouvrage->getParam($param)) |
|
27 | 27 | ) { |
28 | 28 | $this->ouvrage->setParam($param, WikiTextUtil::unWikify($this->ouvrage->getParam($param))); |
29 | 29 | } |
@@ -47,7 +47,7 @@ |
||
47 | 47 | if ($lang2 && $lang !== $lang2) { |
48 | 48 | $this->ouvrage->setParam($this->langParam, $lang2); |
49 | 49 | if (OuvrageOptimize::WIKI_LANGUAGE !== $lang2) { |
50 | - $this->optiStatus->addSummaryLog('±' . $this->langParam); |
|
50 | + $this->optiStatus->addSummaryLog('±'.$this->langParam); |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | } |
@@ -29,12 +29,12 @@ discard block |
||
29 | 29 | $auteur1 = $this->ouvrage->getParam('auteur') ?? ''; |
30 | 30 | $auteur1 .= $this->ouvrage->getParam('auteurs') ?? ''; |
31 | 31 | $auteur1 .= $this->ouvrage->getParam('prénom1') ?? ''; |
32 | - $auteur1 .= ' ' . $this->ouvrage->getParam('nom1') ?? ''; |
|
32 | + $auteur1 .= ' '.$this->ouvrage->getParam('nom1') ?? ''; |
|
33 | 33 | $auteur1 = trim($auteur1); |
34 | 34 | // of authors 2 |
35 | 35 | $auteur2 = $this->ouvrage->getParam('auteur2') ?? ''; |
36 | 36 | $auteur2 .= $this->ouvrage->getParam('prénom2') ?? ''; |
37 | - $auteur2 .= ' ' . $this->ouvrage->getParam('nom2') ?? ''; |
|
37 | + $auteur2 .= ' '.$this->ouvrage->getParam('nom2') ?? ''; |
|
38 | 38 | $auteur2 = trim($auteur2); |
39 | 39 | |
40 | 40 | // skip if wikilink in author |
@@ -45,21 +45,21 @@ discard block |
||
45 | 45 | $machine = new PredictAuthors(); |
46 | 46 | $res = $machine->predictAuthorNames($auteur1); |
47 | 47 | |
48 | - if (1 === count((array)$res)) { |
|
48 | + if (1 === count((array) $res)) { |
|
49 | 49 | // auteurs->auteur? |
50 | 50 | return; |
51 | 51 | } |
52 | 52 | // Many authors... and empty "auteur2" |
53 | - if (count((array)$res) >= 2 && empty($auteur2)) { |
|
53 | + if (count((array) $res) >= 2 && empty($auteur2)) { |
|
54 | 54 | // delete author-params |
55 | 55 | array_map( |
56 | - function ($param) { |
|
56 | + function($param) { |
|
57 | 57 | $this->ouvrage->unsetParam($param); |
58 | 58 | }, |
59 | 59 | ['auteur', 'auteurs', 'prénom1', 'nom1'] |
60 | 60 | ); |
61 | 61 | // iterate and edit new values |
62 | - $count = count((array)$res); |
|
62 | + $count = count((array) $res); |
|
63 | 63 | for ($i = 0; $i < $count; ++$i) { |
64 | 64 | $this->ouvrage->setParam(sprintf('auteur%s', $i + 1), $res[$i]); |
65 | 65 | } |
@@ -64,7 +64,7 @@ |
||
64 | 64 | |
65 | 65 | private function isEditionYear(string $str): bool |
66 | 66 | { |
67 | - return preg_match('#^\d{4}$#', $str) && (int)$str > 1700 && (int)$str < 2025; |
|
67 | + return preg_match('#^\d{4}$#', $str) && (int) $str > 1700 && (int) $str < 2025; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | private function correctReimpressionByParam(string $param): void |
@@ -35,7 +35,7 @@ |
||
35 | 35 | { |
36 | 36 | public const CONVERT_GOOGLEBOOK_TEMPLATE = false; // change OuvrageOptimizeTest !! |
37 | 37 | public const WIKI_LANGUAGE = 'fr'; |
38 | - public const PUBLISHER_FRWIKI_FILENAME = __DIR__ . '/../resources/data_editors_wiki.json'; |
|
38 | + public const PUBLISHER_FRWIKI_FILENAME = __DIR__.'/../resources/data_editors_wiki.json'; |
|
39 | 39 | |
40 | 40 | /** |
41 | 41 | * @var OptiStatus |