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, 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); } diff --git a/tests/Composer/Test/ConfigTest.php b/tests/Composer/Test/ConfigTest.php index 579987a52..de00785a2 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 { @@ -325,22 +326,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')); @@ -355,9 +358,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'); } }