Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. IniFileLoader.php

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\Loader

Code

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),
    
    };
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal