8000 [DI] align IniFileLoader to PHP bugfix #76965 by nicolas-grekas · Pull Request #29165 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DI] align IniFileLoader to PHP bugfix #76965 #29165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
< 8000 div id="files" class="diff-view js-diff-container" data-hpc>
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ public function supports($resource, $type = null)
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public function testTypeConversionsWithNativePhp($key, $value, $supported)
$this->markTe 7735 stSkipped(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');
}
Expand All @@ -78,9 +77,10 @@ public function getTypeConversions()
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),
Expand Down
0