diff --git a/src/Composer/Autoload/ClassMapGenerator.php b/src/Composer/Autoload/ClassMapGenerator.php index 9a8381224..cb948945f 100644 --- a/src/Composer/Autoload/ClassMapGenerator.php +++ b/src/Composer/Autoload/ClassMapGenerator.php @@ -272,7 +272,7 @@ class ClassMapGenerator if ($name[0] === ':') { // This is an XHP class, https://github.com/facebook/xhp $name = 'xhp'.substr(str_replace(array('-', ':'), array('_', '__'), $name), 1); - } elseif ($matches['type'][$i] === 'enum') { + } elseif (strtolower($matches['type'][$i]) === 'enum') { // something like: // enum Foo: int { HERP = '123'; } // The regex above captures the colon, which isn't part of diff --git a/src/Composer/Plugin/PluginManager.php b/src/Composer/Plugin/PluginManager.php index 1e0181a73..b1068b090 100644 --- a/src/Composer/Plugin/PluginManager.php +++ b/src/Composer/Plugin/PluginManager.php @@ -656,7 +656,7 @@ class PluginManager } if (false === $allowPluginsConfig) { - return array('{^$}D' => false); + return array('{}' => false); } $rules = array(); diff --git a/src/Composer/Repository/ComposerRepository.php b/src/Composer/Repository/ComposerRepository.php index add7d9a6c..34c8dd2a4 100644 --- a/src/Composer/Repository/ComposerRepository.php +++ b/src/Composer/Repository/ComposerRepository.php @@ -652,7 +652,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito return array(); } - if ($this->providersUrl) { + if (null !== $this->providersUrl && null !== $this->providerListing) { return array_keys($this->providerListing); } diff --git a/tests/Composer/Test/Autoload/Fixtures/php8.1/enum_backed.php b/tests/Composer/Test/Autoload/Fixtures/php8.1/enum_backed.php index bab09e31b..3954c43e8 100644 --- a/tests/Composer/Test/Autoload/Fixtures/php8.1/enum_backed.php +++ b/tests/Composer/Test/Autoload/Fixtures/php8.1/enum_backed.php @@ -1,6 +1,6 @@ assertEquals(0, $config->get('process-timeout')); + $result = $config->get('process-timeout'); Platform::clearEnv('COMPOSER_PROCESS_TIMEOUT'); + + $this->assertEquals(0, $result); } public function testHtaccessProtect() { Platform::putEnv('COMPOSER_HTACCESS_PROTECT', '0'); $config = new Config(true); - $this->assertEquals(0, $config->get('htaccess-protect')); + $result = $config->get('htaccess-protect'); Platform::clearEnv('COMPOSER_HTACCESS_PROTECT'); + + $this->assertEquals(0, $result); } public function testGetSourceOfValue() @@ -360,7 +364,9 @@ class ConfigTest extends TestCase { Platform::putEnv('COMPOSER_HTACCESS_PROTECT', '0'); $config = new Config; - $this->assertEquals('COMPOSER_HTACCESS_PROTECT', $config->getSourceOfValue('htaccess-protect')); + $result = $config->getSourceOfValue('htaccess-protect'); Platform::clearEnv('COMPOSER_HTACCESS_PROTECT'); + + $this->assertEquals('COMPOSER_HTACCESS_PROTECT', $result); } }