Merge branch '3.4' into 4.1
* 3.4: [DI] align IniFileLoader to PHP bugfix #76965
This commit is contained in:
commit
4b67acaa71
@ -70,7 +70,9 @@ class IniFileLoader extends FileLoader
|
||||
private function phpize($value)
|
||||
{
|
||||
// trim on the right as comments removal keep whitespaces
|
||||
$value = rtrim($value);
|
||||
if ($value !== $v = rtrim($value)) {
|
||||
$value = '""' === substr_replace($v, '', 1, -1) ? substr($v, 1, -1) : $v;
|
||||
}
|
||||
$lowercaseValue = strtolower($value);
|
||||
|
||||
switch (true) {
|
||||
|
@ -11,9 +11,10 @@
|
||||
constant = PHP_VERSION
|
||||
12 = 12
|
||||
12_string = '12'
|
||||
12_quoted_number = "12"
|
||||
12_comment = 12 ; comment
|
||||
12_string_comment = '12' ; comment
|
||||
12_string_comment_again = "12" ; comment
|
||||
12_quoted_number_comment = "12" ; comment
|
||||
-12 = -12
|
||||
0 = 0
|
||||
1 = 1
|
||||
|
@ -53,7 +53,6 @@ class IniFileLoaderTest extends TestCase
|
||||
$this->markTestSkipped(sprintf('Converting the value "%s" to "%s" is not supported by the IniFileLoader.', $key, $value));
|
||||
}
|
||||
|
||||
$this->loader->load('types.ini');
|
||||
$expected = parse_ini_file(__DIR__.'/../Fixtures/ini/types.ini', true, INI_SCANNER_TYPED);
|
||||
$this->assertSame($value, $expected['parameters'][$key], '->load() converts values to PHP types');
|
||||
}
|
||||
@ -73,9 +72,10 @@ class IniFileLoaderTest extends TestCase
|
||||
array('constant', PHP_VERSION, true),
|
||||
array('12', 12, true),
|
||||
array('12_string', '12', true),
|
||||
array('12_quoted_number', 12, false), // INI_SCANNER_RAW removes the double quotes
|
||||
array('12_comment', 12, true),
|
||||
array('12_string_comment', '12', true),
|
||||
array('12_string_comment_again', '12', true),
|
||||
array('12_quoted_number_comment', 12, false), // INI_SCANNER_RAW removes the double quotes
|
||||
array('-12', -12, true),
|
||||
array('1', 1, true),
|
||||
array('0', 0, true),
|
||||
|
Reference in New Issue
Block a user