Merge branch '2.2' into main
commit
45218092b4
|
@ -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
|
||||
|
|
|
@ -656,7 +656,7 @@ class PluginManager
|
|||
}
|
||||
|
||||
if (false === $allowPluginsConfig) {
|
||||
return array('{^$}D' => false);
|
||||
return array('{}' => false);
|
||||
}
|
||||
|
||||
$rules = array();
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
enum RolesBackedEnum:string {
|
||||
EnUm RolesBackedEnum:string {
|
||||
case Admin = 'Administrator';
|
||||
case Guest = 'Guest';
|
||||
case Moderator = 'Moderator';
|
||||
|
|
|
@ -328,16 +328,20 @@ class ConfigTest extends TestCase
|
|||
{
|
||||
Platform::putEnv('COMPOSER_PROCESS_TIMEOUT', '0');
|
||||
$config = new Config(true);
|
||||
$this->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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue