@@ -109,13 +109,13 @@ |
||
| 109 | 109 | // generer un marqueur qui n'existe pas dans le texte |
| 110 | 110 | do { |
| 111 | 111 | $this->markId = substr(md5(uniqid(static::class, 1)), 0, 7); |
| 112 | - $this->markId = '@|' . static::$markPrefix . $this->markId . '|'; |
|
| 112 | + $this->markId = '@|'.static::$markPrefix.$this->markId.'|'; |
|
| 113 | 113 | } while (str_contains($texte, $this->markId)); |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | $offset_pos = 0; |
| 117 | 117 | foreach ($collection as $c) { |
| 118 | - $rempl = $this->markId . base64_encode((string) $c['raw']) . '|@'; |
|
| 118 | + $rempl = $this->markId.base64_encode((string) $c['raw']).'|@'; |
|
| 119 | 119 | $texte = substr_replace($texte, $rempl, $c['pos'] + $offset_pos, $c['length']); |
| 120 | 120 | $offset_pos += strlen($rempl) - $c['length']; |
| 121 | 121 | } |
@@ -205,9 +205,9 @@ |
||
| 205 | 205 | // il ne faut pas echapper en div si propre produit un seul paragraphe |
| 206 | 206 | include_spip('inc/texte'); |
| 207 | 207 | $trad_propre = preg_replace(',(^<p[^>]*>|</p>$),Uims', '', (string) propre($trad)); |
| 208 | - $mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 208 | + $mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 209 | 209 | if ($mode === 'div') { |
| 210 | - $trad = rtrim((string) $trad) . "\n\n"; |
|
| 210 | + $trad = rtrim((string) $trad)."\n\n"; |
|
| 211 | 211 | } |
| 212 | 212 | $trad = code_echappement($trad, 'multi', false, $mode); |
| 213 | 213 | $trad = str_replace("'", '"', (string) inserer_attribut($trad, 'lang', $l)); |
@@ -65,17 +65,17 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | $page_title = ($options['page_title'] ?? $GLOBALS['meta']['nom_site']); |
| 67 | 67 | $doctype = ($options['doctype'] ?? '<!DOCTYPE html>'); |
| 68 | - $doctype = trim((string) $doctype) . "\n"; |
|
| 68 | + $doctype = trim((string) $doctype)."\n"; |
|
| 69 | 69 | $charset = ($options['charset'] ?? 'utf-8'); |
| 70 | 70 | $all_inline = ($options['all_inline'] ?? true); |
| 71 | 71 | $onLoad = ($options['onLoad'] ?? ''); |
| 72 | 72 | if ($onLoad) { |
| 73 | - $onLoad = ' onload="' . attribut_html($onLoad) . '"'; |
|
| 73 | + $onLoad = ' onload="'.attribut_html($onLoad).'"'; |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | # envoyer le charset |
| 77 | 77 | if (!headers_sent()) { |
| 78 | - header('Content-Type: text/html; charset=' . $charset); |
|
| 78 | + header('Content-Type: text/html; charset='.$charset); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | $css = ''; |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | . "--minipage-color-theme--s: $s;" |
| 95 | 95 | . "--minipage-color-theme--l: $l;}"; |
| 96 | 96 | $vars = file_get_contents(find_in_theme('minipage.vars.css')); |
| 97 | - $inline .= "\n" . trim($vars); |
|
| 97 | + $inline .= "\n".trim($vars); |
|
| 98 | 98 | if (function_exists('minifier')) { |
| 99 | 99 | $inline = minifier($inline, 'css'); |
| 100 | 100 | } |
@@ -121,31 +121,31 @@ discard block |
||
| 121 | 121 | } |
| 122 | 122 | $css = "$inline\n$css"; |
| 123 | 123 | if (!empty($options['css'])) { |
| 124 | - $css .= "\n" . $options['css']; |
|
| 124 | + $css .= "\n".$options['css']; |
|
| 125 | 125 | } |
| 126 | 126 | $css = "<style type='text/css'>$css</style>"; |
| 127 | 127 | } else { |
| 128 | 128 | $css = "<style type='text/css'>$inline</style>"; |
| 129 | 129 | foreach ($files as $name) { |
| 130 | 130 | $file = timestamp(direction_css($name)); |
| 131 | - $css .= "<link rel='stylesheet' href='" . attribut_html($file) . "' type='text/css' />\n"; |
|
| 131 | + $css .= "<link rel='stylesheet' href='".attribut_html($file)."' type='text/css' />\n"; |
|
| 132 | 132 | } |
| 133 | 133 | if (!empty($options['css'])) { |
| 134 | - $css .= "<style type='text/css'>" . $options['css'] . '</style>'; |
|
| 134 | + $css .= "<style type='text/css'>".$options['css'].'</style>'; |
|
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - return $doctype . |
|
| 139 | - html_lang_attributes() . |
|
| 140 | - "<head>\n" . |
|
| 141 | - '<title>' . |
|
| 142 | - textebrut($page_title) . |
|
| 143 | - "</title>\n" . |
|
| 144 | - "<meta name=\"viewport\" content=\"width=device-width\" />\n" . |
|
| 145 | - $css . |
|
| 146 | - (empty($options['head']) ? '' : $options['head']) . |
|
| 147 | - "</head>\n" . |
|
| 148 | - "<body{$onLoad} class=\"minipage" . ($this::TYPE ? ' minipage--' . $this::TYPE : '') . "\">\n" . |
|
| 138 | + return $doctype. |
|
| 139 | + html_lang_attributes(). |
|
| 140 | + "<head>\n". |
|
| 141 | + '<title>'. |
|
| 142 | + textebrut($page_title). |
|
| 143 | + "</title>\n". |
|
| 144 | + "<meta name=\"viewport\" content=\"width=device-width\" />\n". |
|
| 145 | + $css. |
|
| 146 | + (empty($options['head']) ? '' : $options['head']). |
|
| 147 | + "</head>\n". |
|
| 148 | + "<body{$onLoad} class=\"minipage".($this::TYPE ? ' minipage--'.$this::TYPE : '')."\">\n". |
|
| 149 | 149 | "\t<div class=\"minipage-bloc\">\n"; |
| 150 | 150 | } |
| 151 | 151 | |
@@ -156,16 +156,16 @@ discard block |
||
| 156 | 156 | */ |
| 157 | 157 | protected function ouvreCorps($options = []) { |
| 158 | 158 | $url_site = url_de_base(); |
| 159 | - $header = "<header>\n" . |
|
| 160 | - '<h1><a href="' . attribut_html($url_site) . '">' . interdire_scripts($GLOBALS['meta']['nom_site'] ?? '') . "</a></h1>\n"; |
|
| 159 | + $header = "<header>\n". |
|
| 160 | + '<h1><a href="'.attribut_html($url_site).'">'.interdire_scripts($GLOBALS['meta']['nom_site'] ?? '')."</a></h1>\n"; |
|
| 161 | 161 | |
| 162 | 162 | $titre = ($options['titre'] ?? ''); |
| 163 | 163 | if ($titre) { |
| 164 | - $header .= '<h2>' . interdire_scripts($titre) . '</h2>'; |
|
| 164 | + $header .= '<h2>'.interdire_scripts($titre).'</h2>'; |
|
| 165 | 165 | } |
| 166 | 166 | $header .= '</header>'; |
| 167 | 167 | |
| 168 | - return $header . "<div class='corps'>\n"; |
|
| 168 | + return $header."<div class='corps'>\n"; |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | /** |
@@ -179,13 +179,13 @@ discard block |
||
| 179 | 179 | if (isset($options['footer'])) { |
| 180 | 180 | $footer = $options['footer']; |
| 181 | 181 | } else { |
| 182 | - $footer = '<a href="' . attribut_html($url_site) . '">' . _T('retour') . "</a>\n"; |
|
| 182 | + $footer = '<a href="'.attribut_html($url_site).'">'._T('retour')."</a>\n"; |
|
| 183 | 183 | } |
| 184 | 184 | if (!empty($footer)) { |
| 185 | 185 | $footer = "<footer>\n{$footer}</footer>"; |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | - return "</div>\n" . $footer; |
|
| 188 | + return "</div>\n".$footer; |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | return $this->iter->{$nom}(); |
| 136 | 136 | } catch (Exception) { |
| 137 | 137 | // #GETCHILDREN sur un fichier de DirectoryIterator ... |
| 138 | - spip_log("Methode {$nom} en echec sur " . $this->iter::class); |
|
| 138 | + spip_log("Methode {$nom} en echec sur ".$this->iter::class); |
|
| 139 | 139 | spip_log("Cela peut être normal : retour d'une ligne de resultat ne pouvant pas calculer cette methode"); |
| 140 | 140 | |
| 141 | 141 | return ''; |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | return null; |
| 357 | 357 | } |
| 358 | 358 | |
| 359 | - return '(' . implode(") {$operateur} (", $filtres_string) . ')'; |
|
| 359 | + return '('.implode(") {$operateur} (", $filtres_string).')'; |
|
| 360 | 360 | } |
| 361 | 361 | |
| 362 | 362 | /** |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | return $this->composer_filtre($v[1], $v[0], $v[2]); |
| 440 | 440 | } |
| 441 | 441 | |
| 442 | - return null; // sera ignore |
|
| 442 | + return null; // sera ignore |
|
| 443 | 443 | } |
| 444 | 444 | |
| 445 | 445 | /** |
@@ -468,28 +468,28 @@ discard block |
||
| 468 | 468 | // if (!in_array($cle, array('cle', 'valeur'))) |
| 469 | 469 | // return; |
| 470 | 470 | |
| 471 | - $a = '$this->get_select(\'' . $cle . '\')'; |
|
| 471 | + $a = '$this->get_select(\''.$cle.'\')'; |
|
| 472 | 472 | |
| 473 | 473 | $filtre = ''; |
| 474 | 474 | |
| 475 | 475 | if ('REGEXP' == $op) { |
| 476 | - $filtre = 'filtrer("match", ' . $a . ', ' . str_replace('\"', '"', (string) $valeur) . ')'; |
|
| 476 | + $filtre = 'filtrer("match", '.$a.', '.str_replace('\"', '"', (string) $valeur).')'; |
|
| 477 | 477 | $op = ''; |
| 478 | 478 | } else { |
| 479 | 479 | if ('LIKE' == $op) { |
| 480 | 480 | $valeur = str_replace(['\"', '_', '%'], ['"', '.', '.*'], preg_quote((string) $valeur)); |
| 481 | - $filtre = 'filtrer("match", ' . $a . ', ' . $valeur . ')'; |
|
| 481 | + $filtre = 'filtrer("match", '.$a.', '.$valeur.')'; |
|
| 482 | 482 | $op = ''; |
| 483 | 483 | } else { |
| 484 | 484 | if ('=' == $op) { |
| 485 | 485 | $op = '=='; |
| 486 | 486 | } else { |
| 487 | 487 | if ('IN' == $op) { |
| 488 | - $filtre = 'in_array(' . $a . ', array' . $valeur . ')'; |
|
| 488 | + $filtre = 'in_array('.$a.', array'.$valeur.')'; |
|
| 489 | 489 | $op = ''; |
| 490 | 490 | } else { |
| 491 | 491 | if (!in_array($op, ['<', '<=', '>', '>='])) { |
| 492 | - spip_log('operateur non reconnu ' . $op); // [todo] mettre une erreur de squelette |
|
| 492 | + spip_log('operateur non reconnu '.$op); // [todo] mettre une erreur de squelette |
|
| 493 | 493 | $op = ''; |
| 494 | 494 | } |
| 495 | 495 | } |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | } |
| 499 | 499 | |
| 500 | 500 | if ($op) { |
| 501 | - $filtre = $a . $op . str_replace('\"', '"', (string) $valeur); |
|
| 501 | + $filtre = $a.$op.str_replace('\"', '"', (string) $valeur); |
|
| 502 | 502 | } |
| 503 | 503 | |
| 504 | 504 | if ($not) { |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | // Creer la fonction de filtrage sur $this |
| 548 | 548 | if ($this->filtre) { |
| 549 | 549 | if ($filtres = $this->assembler_filtres($this->filtre)) { |
| 550 | - $filtres = 'return ' . $filtres . ';'; |
|
| 550 | + $filtres = 'return '.$filtres.';'; |
|
| 551 | 551 | $this->func_filtre = fn () => eval($filtres); |
| 552 | 552 | } else { |
| 553 | 553 | $this->func_filtre = null; |
@@ -51,12 +51,12 @@ |
||
| 51 | 51 | // chercher la classe d'iterateur Iterateur/XXX |
| 52 | 52 | // definie dans le fichier src/Compilateur/Iterateur/xxx.php |
| 53 | 53 | // FIXME: déclarer quelque part les iterateurs supplémentaires |
| 54 | - $class = __NAMESPACE__ . '\\' . ucfirst(strtolower((string) $iterateur)); |
|
| 54 | + $class = __NAMESPACE__.'\\'.ucfirst(strtolower((string) $iterateur)); |
|
| 55 | 55 | if (!class_exists($class)) { |
| 56 | 56 | // historique |
| 57 | 57 | // Chercher IterateurXXX |
| 58 | - include_spip('iterateur/' . $iterateur); |
|
| 59 | - $class = 'Iterateur' . $iterateur; |
|
| 58 | + include_spip('iterateur/'.$iterateur); |
|
| 59 | + $class = 'Iterateur'.$iterateur; |
|
| 60 | 60 | if (!class_exists($class)) { |
| 61 | 61 | exit("Iterateur {$iterateur} non trouvé"); |
| 62 | 62 | // si l'iterateur n'existe pas, on se rabat sur le generique |