Completed
Push — master ( 0b0cf9...f2008e )
by cam
01:42
created
ecrire/tests/Plugin/DirPluginsSupplTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -10,17 +10,17 @@  discard block
 block discarded – undo
10 10
 
11 11
 class DirPluginsSupplTest extends TestCase
12 12
 {
13
-	const DIR_PLUGINS_SUPPL = _DIR_TMP . 'test_dir_plugins_suppl/';
14
-	const DIR_PLUGINS_OUTSIDE = _DIR_TMP . 'test_dir_plugins_outisde/';
13
+	const DIR_PLUGINS_SUPPL = _DIR_TMP.'test_dir_plugins_suppl/';
14
+	const DIR_PLUGINS_OUTSIDE = _DIR_TMP.'test_dir_plugins_outisde/';
15 15
 	const PAQUET_TEST = 'toto/paquet.xml';
16 16
 
17 17
 	public static function setUpBeforeClass(): void {
18 18
 		find_in_path('./inc/plugin.php', '', true);
19 19
 		supprimer_repertoire(self::DIR_PLUGINS_SUPPL);
20
-		mkdir(self::DIR_PLUGINS_SUPPL . 'toto', 0777, true);
21
-		mkdir(self::DIR_PLUGINS_OUTSIDE . 'toto', 0777, true);
22
-		copy(__DIR__ . '/data/paquet.xml', self::DIR_PLUGINS_SUPPL . self::PAQUET_TEST);
23
-		copy(__DIR__ . '/data/paquet.xml', self::DIR_PLUGINS_OUTSIDE . self::PAQUET_TEST);
20
+		mkdir(self::DIR_PLUGINS_SUPPL.'toto', 0777, true);
21
+		mkdir(self::DIR_PLUGINS_OUTSIDE.'toto', 0777, true);
22
+		copy(__DIR__.'/data/paquet.xml', self::DIR_PLUGINS_SUPPL.self::PAQUET_TEST);
23
+		copy(__DIR__.'/data/paquet.xml', self::DIR_PLUGINS_OUTSIDE.self::PAQUET_TEST);
24 24
 	}
25 25
 
26 26
 	public static function tearDownAfterClass(): void {
@@ -47,10 +47,10 @@  discard block
 block discarded – undo
47 47
 	public function testDirectory() {
48 48
 		// le rep suppl existe
49 49
 		$this->assertTrue(is_dir(self::DIR_PLUGINS_SUPPL), sprintf('Le répertoire "%s" aurait du être créé', self::DIR_PLUGINS_SUPPL));
50
-		$this->assertTrue(file_exists(self::DIR_PLUGINS_SUPPL . self::PAQUET_TEST), sprintf('Le fichier "%s" aurait du être créé', self::DIR_PLUGINS_SUPPL . self::PAQUET_TEST));
50
+		$this->assertTrue(file_exists(self::DIR_PLUGINS_SUPPL.self::PAQUET_TEST), sprintf('Le fichier "%s" aurait du être créé', self::DIR_PLUGINS_SUPPL.self::PAQUET_TEST));
51 51
 		// le rep outside existe
52 52
 		$this->assertTrue(is_dir(self::DIR_PLUGINS_OUTSIDE), sprintf('Le répertoire "%s" aurait du être créé', self::DIR_PLUGINS_OUTSIDE));
53
-		$this->assertTrue(file_exists(self::DIR_PLUGINS_OUTSIDE . self::PAQUET_TEST), sprintf('Le fichier "%s" aurait du être créé', self::DIR_PLUGINS_OUTSIDE . self::PAQUET_TEST));
53
+		$this->assertTrue(file_exists(self::DIR_PLUGINS_OUTSIDE.self::PAQUET_TEST), sprintf('Le fichier "%s" aurait du être créé', self::DIR_PLUGINS_OUTSIDE.self::PAQUET_TEST));
54 54
 	}
55 55
 
56 56
 	#[Depends('testDirectory')]
Please login to merge, or discard this patch.
ecrire/tests/Api/AutoriserTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 {
11 11
 	public static function setUpBeforeClass(): void {
12 12
 		include_spip('inc/autoriser');
13
-		require_once(__DIR__ . '/data/autoriser.php');
13
+		require_once(__DIR__.'/data/autoriser.php');
14 14
 	}
15 15
 
16 16
 	public function testAutoriserOkNiet(): void {
Please login to merge, or discard this patch.
ecrire/tests/Format/Xml/SpipXmlParseTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 	public static function providerXmlSpipXmlParse(): array {
27 27
 		$essais = [];
28
-		$xml1 = '<' . <<<CODE_SAMPLE
28
+		$xml1 = '<'.<<<CODE_SAMPLE
29 29
 ?xml version="1.0" encoding="utf-8"?>
30 30
 <urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
31 31
 <url><loc>http://localhost/_core/spip/spip.php?breve25</loc>
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 		$tree1 = <<<CODE_SAMPLE
48 48
 a:1:{s:57:"urlset xmlns="http://www.google.com/schemas/sitemap/0.84"";a:1:{i:0;a:1:{s:3:"url";a:3:{i:0;a:3:{s:3:"loc";a:1:{i:0;s:44:"http://localhost/_core/spip/spip.php?breve25";}s:7:"lastmod";a:1:{i:0;s:10:"2003-12-31";}s:8:"priority";a:1:{i:0;s:3:"0.8";}}i:1;a:3:{s:3:"loc";a:1:{i:0;s:44:"http://localhost/_core/spip/spip.php?breve32";}s:7:"lastmod";a:1:{i:0;s:10:"2004-02-10";}s:8:"priority";a:1:{i:0;s:3:"0.8";}}i:2;a:3:{s:3:"loc";a:1:{i:0;s:44:"http://localhost/_core/spip/spip.php?breve64";}s:7:"lastmod";a:1:{i:0;s:10:"2005-01-31";}s:8:"priority";a:1:{i:0;s:3:"0.8";}}}}}}
49 49
 CODE_SAMPLE;
50
-		$xml2 = '<' . <<<CODE_SAMPLE
50
+		$xml2 = '<'.<<<CODE_SAMPLE
51 51
 ?xml version="1.0" encoding="UTF-8"?>
52 52
 <opml version="1.0">
53 53
   <head>
Please login to merge, or discard this patch.
ecrire/tests/Urls/LiensAbsolusTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
 	public function testLienPrive() {
23 23
 		$relatif = generer_url_ecrire('toto', 'truc=machin&chose=bidule', false, true);
24 24
 		$absolu = generer_url_ecrire('toto', 'truc=machin&chose=bidule', false, false);
25
-		$expected = 'bla bla <a href=\'' . str_replace('&amp;', '&#38;', $absolu) . '\'>lien prive</a>';
26
-		$case = 'bla bla <a href=\'' . $relatif . '\'>lien prive</a>';
25
+		$expected = 'bla bla <a href=\''.str_replace('&amp;', '&#38;', $absolu).'\'>lien prive</a>';
26
+		$case = 'bla bla <a href=\''.$relatif.'\'>lien prive</a>';
27 27
 		$actual = liens_absolus($case);
28 28
 		$this->assertEquals($expected, $actual);
29 29
 	}
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
 	public function testLienPublic() {
33 33
 		$relatif = generer_url_public('toto', 'truc=machin&chose=bidule', false, true);
34 34
 		$absolu = generer_url_public('toto', 'truc=machin&chose=bidule', false, false);
35
-		$expected = 'bla bla <a href=\'' . str_replace('&amp;', '&#38;', $absolu) . '\'>lien public</a>';
36
-		$case = 'bla bla <a href=\'' . $relatif . '\'>lien public</a>';
35
+		$expected = 'bla bla <a href=\''.str_replace('&amp;', '&#38;', $absolu).'\'>lien public</a>';
36
+		$case = 'bla bla <a href=\''.$relatif.'\'>lien public</a>';
37 37
 		$actual = liens_absolus($case);
38 38
 		$this->assertEquals($expected, $actual);
39 39
 	}
Please login to merge, or discard this patch.
ecrire/tests/Filesystem/FlockTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,16 +14,16 @@
 block discarded – undo
14 14
 	}
15 15
 
16 16
 	public function testSousRepertoire(): void {
17
-		$sous_repertoire = 'test' . md5(strval(random_int(0, mt_getrandmax())));
17
+		$sous_repertoire = 'test'.md5(strval(random_int(0, mt_getrandmax())));
18 18
 		$this->assertSame(
19 19
 			sous_repertoire(_DIR_VAR, $sous_repertoire),
20
-			_DIR_VAR . $sous_repertoire . '/'
20
+			_DIR_VAR.$sous_repertoire.'/'
21 21
 		);
22
-		$this->assertTrue(file_exists(_DIR_VAR . $sous_repertoire));
23
-		$this->assertTrue(is_dir(_DIR_VAR . $sous_repertoire));
22
+		$this->assertTrue(file_exists(_DIR_VAR.$sous_repertoire));
23
+		$this->assertTrue(is_dir(_DIR_VAR.$sous_repertoire));
24 24
 
25 25
 		// Nettoyage
26
-		@unlink(_DIR_VAR . $sous_repertoire . '/.ok');
27
-		@rmdir(_DIR_VAR . $sous_repertoire);
26
+		@unlink(_DIR_VAR.$sous_repertoire.'/.ok');
27
+		@rmdir(_DIR_VAR.$sous_repertoire);
28 28
 	}
29 29
 }
Please login to merge, or discard this patch.
ecrire/tests/Filesystem/CreerCheminTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 
29 29
 		$this->assertIsArray($_chemins);
30 30
 		$this->assertEquals(count($chemins), count($_chemins) - 1, 'Erreur ajout chemin par la fonction _chemin() : mauvais compte');
31
-		if (is_dir(_DIR_RACINE . 'squelettes')) {
31
+		if (is_dir(_DIR_RACINE.'squelettes')) {
32 32
 			$this->assertEquals('toto/', $_chemins[1], 'Erreur ajout chemin par la fonction _chemin() : avec squelettes');
33 33
 		} else {
34 34
 			$this->assertEquals('toto/', $_chemins[0], 'Erreur ajout chemin par la fonction _chemin() : sans squelettes');
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 		$chemins = creer_chemin();
41 41
 		$this->assertIsArray($chemins);
42 42
 
43
-		$squelettes = (int) is_dir(_DIR_RACINE . 'squelettes');
43
+		$squelettes = (int) is_dir(_DIR_RACINE.'squelettes');
44 44
 		$dossier_squelettes = count(explode(':', $GLOBALS['dossier_squelettes']));
45 45
 
46 46
 		_chemin('toto');
Please login to merge, or discard this patch.
ecrire/inc_version.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 define('_DIR_RACINE', _DIR_RESTREINT ? '' : '../');
51 51
 
52 52
 /** chemin absolu vers la racine */
53
-define('_ROOT_RACINE', dirname(__DIR__) . '/');
53
+define('_ROOT_RACINE', dirname(__DIR__).'/');
54 54
 /** chemin absolu vers le repertoire de travail */
55
-define('_ROOT_CWD', getcwd() . '/');
55
+define('_ROOT_CWD', getcwd().'/');
56 56
 /** chemin absolu vers ecrire */
57
-define('_ROOT_RESTREINT', _ROOT_CWD . _DIR_RESTREINT);
57
+define('_ROOT_RESTREINT', _ROOT_CWD._DIR_RESTREINT);
58 58
 
59 59
 # Le nom des 4 repertoires modifiables par les scripts lances par httpd
60 60
 # Par defaut ces 4 noms seront suffixes par _DIR_RACINE (cf plus bas)
@@ -79,13 +79,13 @@  discard block
 block discarded – undo
79 79
 // inclure l'ecran de securite si il n'a pas été inclus en prepend php
80 80
 if (
81 81
 	!defined('_ECRAN_SECURITE')
82
-	&& @file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . 'ecran_securite.php')
82
+	&& @file_exists($f = _ROOT_RACINE._NOM_PERMANENTS_INACCESSIBLES.'ecran_securite.php')
83 83
 ) {
84 84
 	include $f;
85 85
 }
86 86
 
87 87
 // et on peut lancer l'autoloader
88
-require_once __DIR__ . '/../vendor/autoload.php';
88
+require_once __DIR__.'/../vendor/autoload.php';
89 89
 
90 90
 // Icones
91 91
 if (!defined('_NOM_IMG_PACK')) {
@@ -93,17 +93,17 @@  discard block
 block discarded – undo
93 93
 	define('_NOM_IMG_PACK', 'images/');
94 94
 }
95 95
 /** le chemin http (relatif) vers les images standard */
96
-define('_DIR_IMG_PACK', (_DIR_RACINE . 'prive/' . _NOM_IMG_PACK));
96
+define('_DIR_IMG_PACK', (_DIR_RACINE.'prive/'._NOM_IMG_PACK));
97 97
 
98 98
 /** le chemin php (absolu) vers les images standard (pour hebergement centralise) */
99
-define('_ROOT_IMG_PACK', dirname(__DIR__) . '/prive/' . _NOM_IMG_PACK);
99
+define('_ROOT_IMG_PACK', dirname(__DIR__).'/prive/'._NOM_IMG_PACK);
100 100
 
101 101
 if (!defined('_JAVASCRIPT')) {
102 102
 	/** Nom du repertoire des  bibliotheques JavaScript */
103 103
 	define('_JAVASCRIPT', 'javascript/');
104 104
 } // utilisable avec #CHEMIN et find_in_path
105 105
 /** le nom du repertoire des  bibliotheques JavaScript du prive */
106
-define('_DIR_JAVASCRIPT', (_DIR_RACINE . 'prive/' . _JAVASCRIPT));
106
+define('_DIR_JAVASCRIPT', (_DIR_RACINE.'prive/'._JAVASCRIPT));
107 107
 
108 108
 
109 109
 /** Le nom du fichier de personnalisation */
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 }
113 113
 
114 114
 // Son emplacement absolu si on le trouve
115
-if (@file_exists($f = _ROOT_RACINE . _NOM_PERMANENTS_INACCESSIBLES . _NOM_CONFIG . '.php')) {
115
+if (@file_exists($f = _ROOT_RACINE._NOM_PERMANENTS_INACCESSIBLES._NOM_CONFIG.'.php')) {
116 116
 	/** Emplacement absolu du fichier d'option */
117 117
 	define('_FILE_OPTIONS', $f);
118 118
 } else {
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 			// UA plus cibles
148 148
 			. '80legs|accoona|AltaVista|ASPSeek|Baidu|Charlotte|EC2LinkFinder|eStyle|facebook|flipboard|hootsuite|FunWebProducts|Google|Genieo|INA dlweb|InfegyAtlas|Java VM|LiteFinder|Lycos|MetaURI|Moreover|Rambler|Scooter|ScrubbyBloglines|Yahoo|Yeti'
149 149
 			. ',i',
150
-			(string)$_SERVER['HTTP_USER_AGENT']
150
+			(string) $_SERVER['HTTP_USER_AGENT']
151 151
 		)
152 152
 	);
153 153
 }
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 # la matrice standard (fichiers definissant les fonctions a inclure)
390 390
 $spip_matrice = [];
391 391
 # les plugins a activer
392
-$plugins = [];  // voir le contenu du repertoire /plugins/
392
+$plugins = []; // voir le contenu du repertoire /plugins/
393 393
 # les surcharges de include_spip()
394 394
 $surcharges = []; // format 'inc_truc' => '/plugins/chose/inc_truc2.php'
395 395
 
@@ -467,8 +467,8 @@  discard block
 block discarded – undo
467 467
 //
468 468
 // Charger les fonctions liees aux serveurs Http et Sql.
469 469
 //
470
-require_once _ROOT_RESTREINT . 'inc/utils.php';
471
-require_once _ROOT_RESTREINT . 'base/connect_sql.php';
470
+require_once _ROOT_RESTREINT.'inc/utils.php';
471
+require_once _ROOT_RESTREINT.'base/connect_sql.php';
472 472
 
473 473
 // Definition personnelles eventuelles
474 474
 
@@ -492,10 +492,10 @@  discard block
 block discarded – undo
492 492
 // ===> on execute en neutralisant les messages d'erreur
493 493
 
494 494
 spip_initialisation_core(
495
-	(_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES),
496
-	(_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES),
497
-	(_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES),
498
-	(_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES)
495
+	(_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES),
496
+	(_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES),
497
+	(_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES),
498
+	(_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES)
499 499
 );
500 500
 
501 501
 
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 		include_spip('inc/lang');
552 552
 		utiliser_langue_visiteur();
553 553
 		include_spip('inc/minipres');
554
-		echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>" . _T('info_travaux_texte') . '</p>', ['status' => 503]);
554
+		echo minipres(_T('info_travaux_titre'), "<p style='text-align: center;'>"._T('info_travaux_texte').'</p>', ['status' => 503]);
555 555
 		exit;
556 556
 	}
557 557
 	// autrement c'est une install ad hoc (spikini...), on sait pas faire
@@ -590,12 +590,12 @@  discard block
 block discarded – undo
590 590
 	}
591 591
 	if (!isset($GLOBALS['spip_header_silencieux']) || !$GLOBALS['spip_header_silencieux']) {
592 592
 		include_spip('inc/filtres_mini');
593
-		header(_HEADER_COMPOSED_BY . " $spip_version_affichee @ www.spip.net + " . url_absolue(_DIR_VAR . 'config.txt'));
593
+		header(_HEADER_COMPOSED_BY." $spip_version_affichee @ www.spip.net + ".url_absolue(_DIR_VAR.'config.txt'));
594 594
 	} else {
595 595
 		// header minimal
596
-		header(_HEADER_COMPOSED_BY . ' @ www.spip.net');
596
+		header(_HEADER_COMPOSED_BY.' @ www.spip.net');
597 597
 	}
598 598
 }
599 599
 
600 600
 $methode = ($_SERVER['REQUEST_METHOD'] ?? ((php_sapi_name() == 'cli') ? 'cli' : ''));
601
-spip_log($methode . ' ' . self() . ' - ' . _FILE_CONNECT, _LOG_DEBUG);
601
+spip_log($methode.' '.self().' - '._FILE_CONNECT, _LOG_DEBUG);
Please login to merge, or discard this patch.
ecrire/prive.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 // Script pour appeler un squelette apres s'etre authentifie
13 13
 
14
-include_once __DIR__ . '/inc_version.php';
14
+include_once __DIR__.'/inc_version.php';
15 15
 
16 16
 include_spip('inc/cookie');
17 17
 
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	// On reexecute pour deboucher sur le include public.
25 25
 	// autrement on insiste
26 26
 	if (is_array($var_auth)) {
27
-		$var_auth = '../?' . $_SERVER['QUERY_STRING'];
27
+		$var_auth = '../?'.$_SERVER['QUERY_STRING'];
28 28
 		include_spip('inc/session');
29 29
 		// on prolonge le cookie
30 30
 		set_cookie_session(null, time() + 3600 * 24 * 14);
@@ -34,4 +34,4 @@  discard block
 block discarded – undo
34 34
 }
35 35
 
36 36
 // En somme, est prive' ce qui est publiquement nomme'...
37
-include __DIR__ . '/public.php';
37
+include __DIR__.'/public.php';
Please login to merge, or discard this patch.
ecs.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 use Symplify\EasyCodingStandard\Config\ECSConfig;
21 21
 use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
22 22
 
23
-return static function (ECSConfig $ecsConfig): void {
23
+return static function(ECSConfig $ecsConfig): void {
24 24
 	// A. full sets
25 25
 	$ecsConfig->sets([SetList::PSR_12, SetList::SYMPLIFY, SetList::COMMON, SetList::CLEAN_CODE]);
26 26
 	$ecsConfig->rule(NoExtraBlankLinesFixer::class);
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	$ecsConfig->indentation('tab');
37 37
 
38 38
 	$ecsConfig->paths([
39
-		__DIR__ . '/ecrire/tests',
39
+		__DIR__.'/ecrire/tests',
40 40
 		# __DIR__ . '/index.php',
41 41
 		# __DIR__ . '/spip.php',
42 42
 		# __DIR__ . '/ecrire',
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	]);
45 45
 
46 46
 	$ecsConfig->skip([
47
-		__DIR__ . '/ecrire/lang',
47
+		__DIR__.'/ecrire/lang',
48 48
 		ArrayListItemNewlineFixer::class,
49 49
 		ArrayOpenerAndCloserNewlineFixer::class,
50 50
 		AssignmentInConditionSniff::class,
Please login to merge, or discard this patch.