@@ -128,13 +128,13 @@ discard block |
||
| 128 | 128 | // generer un marqueur qui n'existe pas dans le texte |
| 129 | 129 | do { |
| 130 | 130 | $this->markId = substr(md5(uniqid(static::class, 1)), 0, 7); |
| 131 | - $this->markId = '@|' . static::$markPrefix . $this->markId . '|'; |
|
| 131 | + $this->markId = '@|'.static::$markPrefix.$this->markId.'|'; |
|
| 132 | 132 | } while (str_contains($texte, $this->markId)); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | $offset_pos = 0; |
| 136 | 136 | foreach ($collection as $c) { |
| 137 | - $rempl = $this->markId . base64_encode((string) $c['raw']) . '|@'; |
|
| 137 | + $rempl = $this->markId.base64_encode((string) $c['raw']).'|@'; |
|
| 138 | 138 | $texte = substr_replace($texte, $rempl, $c['pos'] + $offset_pos, $c['length']); |
| 139 | 139 | $offset_pos += strlen($rempl) - $c['length']; |
| 140 | 140 | } |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | static $pregBalisesBloc; |
| 180 | 180 | |
| 181 | 181 | if ($pregBalisesBloc === null) { |
| 182 | - $pregBalisesBloc = ',</?(' . implode('|', static::$listeBalisesBloc) . ')[>[:space:]],iS'; |
|
| 182 | + $pregBalisesBloc = ',</?('.implode('|', static::$listeBalisesBloc).')[>[:space:]],iS'; |
|
| 183 | 183 | } |
| 184 | 184 | return (str_contains($texte, '<') && preg_match($pregBalisesBloc, $texte)) ? true : false; |
| 185 | 185 | } |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | include_spip('inc/filtres'); |
| 206 | 206 | } |
| 207 | 207 | foreach ($attributs as $k => $v) { |
| 208 | - $atts .= " $k=\"" . \attribut_html($v) . '"'; |
|
| 208 | + $atts .= " $k=\"".\attribut_html($v).'"'; |
|
| 209 | 209 | } |
| 210 | 210 | } |
| 211 | 211 | |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | # spip_log(spip_htmlspecialchars($texte)); ## pour les curieux |
| 236 | 236 | $max_prof = 5; |
| 237 | 237 | $encore = true; |
| 238 | - while ($encore && str_contains($texte, 'base64' . $source) && $max_prof--) { |
|
| 238 | + while ($encore && str_contains($texte, 'base64'.$source) && $max_prof--) { |
|
| 239 | 239 | $encore = false; |
| 240 | 240 | foreach (['span', 'div'] as $tag) { |
| 241 | 241 | $htmlTagCollecteur = new HtmlTag( |
@@ -204,7 +204,7 @@ |
||
| 204 | 204 | $trad_propre = preg_replace(',(^<p[^>]*>|</p>$),Uims', '', (string) propre($trad)); |
| 205 | 205 | $isBloc = self::echappementTexteContientBaliseBloc($trad_propre); |
| 206 | 206 | if ($isBloc) { |
| 207 | - $trad = rtrim((string) $trad) . "\n\n"; |
|
| 207 | + $trad = rtrim((string) $trad)."\n\n"; |
|
| 208 | 208 | } |
| 209 | 209 | $attributs = ['lang' => $l]; |
| 210 | 210 | if (lang_dir($l) !== lang_dir($lang)) { |
@@ -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/' . strtolower($iterateur)); |
|
| 59 | - $class = 'Iterateur' . $iterateur; |
|
| 58 | + include_spip('iterateur/'.strtolower($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 |
@@ -24,13 +24,13 @@ |
||
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | if (!defined('_DIR_TESTS')) { |
| 27 | - define('_DIR_TESTS', substr(_SPIP_TEST_INC, strlen(_SPIP_TEST_CHDIR) + 1) . '/'); |
|
| 27 | + define('_DIR_TESTS', substr(_SPIP_TEST_INC, strlen(_SPIP_TEST_CHDIR) + 1).'/'); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | // chdir pour charger SPIP |
| 31 | 31 | chdir(_SPIP_TEST_CHDIR); |
| 32 | 32 | |
| 33 | -require_once _SPIP_TEST_CHDIR . '/ecrire/inc_version.php'; |
|
| 33 | +require_once _SPIP_TEST_CHDIR.'/ecrire/inc_version.php'; |
|
| 34 | 34 | |
| 35 | 35 | // pour notice sur recuperer_fond() |
| 36 | 36 | if (!isset($GLOBALS['spip_lang'])) { |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | foreach ($essais as $k => $essai) { |
| 57 | 57 | $expected = array_shift($essai); |
| 58 | - $this->assertEquals($expected, objet_associable(...$essai), "Echec {$k} : objet_associable " . end($essai)); |
|
| 58 | + $this->assertEquals($expected, objet_associable(...$essai), "Echec {$k} : objet_associable ".end($essai)); |
|
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | $this->assertEquals( |
| 133 | 133 | $expected, |
| 134 | 134 | objet_associer(...$essai), |
| 135 | - "Echec {$k} : objet_associer " . json_encode($essai, JSON_THROW_ON_ERROR) |
|
| 135 | + "Echec {$k} : objet_associer ".json_encode($essai, JSON_THROW_ON_ERROR) |
|
| 136 | 136 | ); |
| 137 | 137 | } |
| 138 | 138 | } |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | $this->assertEquals( |
| 208 | 208 | $expected, |
| 209 | 209 | objet_qualifier_liens(...$essai), |
| 210 | - "Echec {$k} : objet_qualifier_liens " . json_encode($essai, JSON_THROW_ON_ERROR) |
|
| 210 | + "Echec {$k} : objet_qualifier_liens ".json_encode($essai, JSON_THROW_ON_ERROR) |
|
| 211 | 211 | ); |
| 212 | 212 | } |
| 213 | 213 | } |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | $this->assertEquals( |
| 288 | 288 | $expected, |
| 289 | 289 | objet_dissocier(...$essai), |
| 290 | - "Echec {$k} : objet_dissocier " . json_encode($essai, JSON_THROW_ON_ERROR) |
|
| 290 | + "Echec {$k} : objet_dissocier ".json_encode($essai, JSON_THROW_ON_ERROR) |
|
| 291 | 291 | ); |
| 292 | 292 | } |
| 293 | 293 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $args[1] ?? '', |
| 49 | 49 | $args[2] ?? false, |
| 50 | 50 | $args[3] ?? '', |
| 51 | - __NAMESPACE__ . '\\callback_test_propre_echappe_html_' |
|
| 51 | + __NAMESPACE__.'\\callback_test_propre_echappe_html_' |
|
| 52 | 52 | ); |
| 53 | 53 | $this->assertSame($expected, $actual); |
| 54 | 54 | |
@@ -83,16 +83,16 @@ discard block |
||
| 83 | 83 | foreach ($attrs as $attr) { |
| 84 | 84 | $cpt = 1; |
| 85 | 85 | foreach ($insides as $inside) { |
| 86 | - $html = "<{$balise}" . ($attr ? " $attr" : '') . ">$inside</$balise>"; |
|
| 86 | + $html = "<{$balise}".($attr ? " $attr" : '').">$inside</$balise>"; |
|
| 87 | 87 | $code_echappe = \code_echappement($html, $source, $no_transform); |
| 88 | 88 | foreach ($befores as $before) { |
| 89 | 89 | foreach ($afters as $after) { |
| 90 | - $texte = $before . $html . $after; |
|
| 90 | + $texte = $before.$html.$after; |
|
| 91 | 91 | foreach ($pregs as $preg) { |
| 92 | 92 | // si preg vide et pas balise svg OU si preg ET balise SVG on attend un echappement |
| 93 | 93 | // sinon on attends le texte d'origine |
| 94 | 94 | if ($preg ? $balise === 'svg' : $balise !== 'svg') { |
| 95 | - $expected = $before . $code_echappe . $after; |
|
| 95 | + $expected = $before.$code_echappe.$after; |
|
| 96 | 96 | } else { |
| 97 | 97 | $expected = $texte; |
| 98 | 98 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | $args[1] ?? '', |
| 116 | 116 | $args[2] ?? false, |
| 117 | 117 | $args[3] ?? '', |
| 118 | - __NAMESPACE__ . '\\callback_test_propre_echappe_html_' |
|
| 118 | + __NAMESPACE__.'\\callback_test_propre_echappe_html_' |
|
| 119 | 119 | ); |
| 120 | 120 | $this->assertSame($expected, $actual); |
| 121 | 121 | } |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | $essais = []; |
| 125 | 125 | $marque = '<span class="base64" title="QQ=="></span>'; |
| 126 | 126 | $essais['simple imbriqué'] = [ |
| 127 | - 'avant 1' . $marque . 'apres 1</code>apres 2', |
|
| 127 | + 'avant 1'.$marque.'apres 1</code>apres 2', |
|
| 128 | 128 | 'avant 1<code class="php"> avant 2<code>le code</code>apres 1</code>apres 2', |
| 129 | 129 | ]; |
| 130 | 130 | $essais['complexe imbriqué'] = [ |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | 'astuce & travaux de mode rigolosastuce & travaux de mode rigolosastuce & travaux de mode rigolosastuce & travaux de mode rigolosastuce & travaux de mode rigolosastuce & travaux de mode rigolosastuce & travaux de mode rigolosastuce & travaux de mode rigolosastuce & travaux de mode rigolosastuce & travaux de mode rigolosastuce & travaux de mode rigolosastuce & travaux de mode rigolosastuce & travaux de mode rigolosastuce & travaux de mode rigolosastuce & travaux de mode rigolos', |
| 183 | 183 | ]; |
| 184 | 184 | $essais['code sans imbrication'] = [ |
| 185 | - 'avant 1' . $marque . 'apres 2', |
|
| 185 | + 'avant 1'.$marque.'apres 2', |
|
| 186 | 186 | 'avant 1<code class="php"> avant 2 code le code code apres 1</code>apres 2', |
| 187 | 187 | ]; |
| 188 | 188 | $essais['pourriture'] = [ |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | $desc = pathinfo($name); |
| 33 | - $fond = $desc['dirname'] . '/' . $desc['filename']; |
|
| 33 | + $fond = $desc['dirname'].'/'.$desc['filename']; |
|
| 34 | 34 | |
| 35 | 35 | return substr($fond, $this->rootLen); |
| 36 | 36 | } |
@@ -23,33 +23,33 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | public function getCacheKey(string $name): string { |
| 26 | - return md5($name . serialize($this->options)); |
|
| 26 | + return md5($name.serialize($this->options)); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * Écrit le code du squelette dans un fichier temporaire de cache |
| 31 | 31 | */ |
| 32 | 32 | public function getSourceFile(string $name): string { |
| 33 | - $fond = $this->cacheDirectory . $this->getCacheKey($name); |
|
| 33 | + $fond = $this->cacheDirectory.$this->getCacheKey($name); |
|
| 34 | 34 | $options = $this->options; |
| 35 | 35 | $code = $name; |
| 36 | 36 | |
| 37 | 37 | if (isset($options['avant_code'])) { |
| 38 | - $code = $options['avant_code'] . $code; |
|
| 38 | + $code = $options['avant_code'].$code; |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | if (isset($options['apres_code'])) { |
| 42 | 42 | $code .= $options['apres_code']; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - $this->ecrire_fichier($fond . '.html', $code); |
|
| 45 | + $this->ecrire_fichier($fond.'.html', $code); |
|
| 46 | 46 | |
| 47 | 47 | if (!empty($options['fonctions'])) { |
| 48 | 48 | // un fichier unique pour ces fonctions |
| 49 | - $func = $this->cacheDirectory . 'func_' . md5($options['fonctions']) . '.php'; |
|
| 49 | + $func = $this->cacheDirectory.'func_'.md5($options['fonctions']).'.php'; |
|
| 50 | 50 | $this->ecrire_fichier($func, $this->php($options['fonctions'])); |
| 51 | 51 | // une inclusion unique de ces fichiers |
| 52 | - $this->ecrire_fichier($fond . '_fonctions.php', $this->php(sprintf('include_once(\'%s\');', $func))); |
|
| 52 | + $this->ecrire_fichier($fond.'_fonctions.php', $this->php(sprintf('include_once(\'%s\');', $func))); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | return $fond; |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * @return string Code php complet |
| 79 | 79 | */ |
| 80 | 80 | private function php(string $code): string { |
| 81 | - return '<' . "?php\n" . $code . "\n?" . '>'; |
|
| 81 | + return '<'."?php\n".$code."\n?".'>'; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | public static function setUpBeforeClass(): void { |
| 29 | 29 | include_spip('inc/texte'); |
| 30 | 30 | changer_langue(static::$lang); |
| 31 | - include_spip(static::$root . 'typographie/' . static::$lang); |
|
| 31 | + include_spip(static::$root.'typographie/'.static::$lang); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | public static function providerBase() { |