function IniFileLoader::phpize
Note that the following features are not supported:
- strings with escaped quotes are not supported "foo\"bar";
- string concatenation ("foo" "bar").
1 call to IniFileLoader::phpize()
- IniFileLoader::load in vendor/
symfony/ dependency-injection/ Loader/ IniFileLoader.php
File
-
vendor/
symfony/ dependency-injection/ Loader/ IniFileLoader.php, line 76
Class
- IniFileLoader
- IniFileLoader loads parameters from INI files.
Namespace
Symfony\Component\DependencyInjection\LoaderCode
private function phpize(string $value) : mixed {
// trim on the right as comments removal keep whitespaces
if ($value !== ($v = rtrim($value))) {
$value = '""' === substr_replace($v, '', 1, -1) ? substr($v, 1, -1) : $v;
}
$lowercaseValue = strtolower($value);
return match (true) { \defined($value) => \constant($value),
'yes' === $lowercaseValue, 'on' === $lowercaseValue => true,
'no' === $lowercaseValue, 'off' === $lowercaseValue, 'none' === $lowercaseValue => false,
isset($value[1]) && ("'" === $value[0] && "'" === $value[\strlen($value) - 1] || '"' === $value[0] && '"' === $value[\strlen($value) - 1]) => substr($value, 1, -1),
default => XmlUtils::phpize($value),
};
}