From 00bac7470e2abf2477b3c3589adb74970452abce Mon Sep 17 00:00:00 2001 From: Fran Moreno Date: Sun, 6 Feb 2022 16:55:58 +0100 Subject: [PATCH 1/3] Remove duplicated keys (#10517) --- .php-cs-fixer.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 4031efea1..9ca5f3ae5 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -33,7 +33,6 @@ return $config->setRules([ 'no_blank_lines_after_phpdoc' => true, 'no_empty_statement' => true, 'no_extra_blank_lines' => true, - 'no_leading_import_slash' => true, 'no_leading_namespace_whitespace' => true, 'no_trailing_comma_in_singleline_array' => true, 'no_whitespace_in_blank_line' => true, @@ -57,7 +56,6 @@ return $config->setRules([ 'no_unused_imports' => true, 'fully_qualified_strict_types' => true, 'single_line_after_imports' => true, - 'fully_qualified_strict_types' => true, //'global_namespace_import' => ['import_classes' => true], 'no_leading_import_slash' => true, 'single_import_per_statement' => true, From eefb4644b03e3fdcd6fba5066895fb67468ac8b4 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 8 Feb 2022 14:24:59 +0100 Subject: [PATCH 2/3] InstallerInterface: describe `getInstallPath()` to return a absolute path (#10524) --- src/Composer/Installer/InstallerInterface.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Installer/InstallerInterface.php b/src/Composer/Installer/InstallerInterface.php index f664a3ab4..fd3015e83 100644 --- a/src/Composer/Installer/InstallerInterface.php +++ b/src/Composer/Installer/InstallerInterface.php @@ -111,10 +111,10 @@ interface InstallerInterface public function cleanup($type, PackageInterface $package, PackageInterface $prevPackage = null); /** - * Returns the installation path of a package + * Returns the absolute installation path of a package. * * @param PackageInterface $package - * @return string path to install to, which MUST not end with a slash + * @return string absolute path to install to, which MUST not end with a slash */ public function getInstallPath(PackageInterface $package); } From 3cb44bc4c0037b32b7eda631b7373ba6d89d163a Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 8 Feb 2022 14:54:46 +0100 Subject: [PATCH 3/3] Fix build with latest setup-php --- tests/Composer/Test/ConfigTest.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/Composer/Test/ConfigTest.php b/tests/Composer/Test/ConfigTest.php index 06f655721..fdf2587a3 100644 --- a/tests/Composer/Test/ConfigTest.php +++ b/tests/Composer/Test/ConfigTest.php @@ -13,6 +13,7 @@ namespace Composer\Test; use Composer\Config; +use Composer\Util\Platform; class ConfigTest extends TestCase { @@ -327,22 +328,24 @@ class ConfigTest extends TestCase public function testProcessTimeout() { - putenv('COMPOSER_PROCESS_TIMEOUT=0'); + Platform::putEnv('COMPOSER_PROCESS_TIMEOUT', '0'); $config = new Config(true); $this->assertEquals(0, $config->get('process-timeout')); - putenv('COMPOSER_PROCESS_TIMEOUT'); + Platform::clearEnv('COMPOSER_PROCESS_TIMEOUT'); } public function testHtaccessProtect() { - putenv('COMPOSER_HTACCESS_PROTECT=0'); + Platform::putEnv('COMPOSER_HTACCESS_PROTECT', '0'); $config = new Config(true); $this->assertEquals(0, $config->get('htaccess-protect')); - putenv('COMPOSER_HTACCESS_PROTECT'); + Platform::clearEnv('COMPOSER_HTACCESS_PROTECT'); } public function testGetSourceOfValue() { + Platform::clearEnv('COMPOSER_PROCESS_TIMEOUT'); + $config = new Config; $this->assertSame(Config::SOURCE_DEFAULT, $config->getSourceOfValue('process-timeout')); @@ -357,9 +360,9 @@ class ConfigTest extends TestCase public function testGetSourceOfValueEnvVariables() { - putenv('COMPOSER_HTACCESS_PROTECT=0'); + Platform::putEnv('COMPOSER_HTACCESS_PROTECT', '0'); $config = new Config; $this->assertEquals('COMPOSER_HTACCESS_PROTECT', $config->getSourceOfValue('htaccess-protect')); - putenv('COMPOSER_HTACCESS_PROTECT'); + Platform::clearEnv('COMPOSER_HTACCESS_PROTECT'); } }