function DeprecationHandler::getConfiguration

Returns the extension configuration.

For historical reasons, the configuration is stored in the SYMFONY_DEPRECATIONS_HELPER environment variable.

Return value

array|false An array of configuration variables, of FALSE if the extension is disabled.

2 calls to DeprecationHandler::getConfiguration()
bootstrap.php in core/tests/bootstrap.php
PhpUnitTestRunner::runCommand in core/lib/Drupal/Core/Test/PhpUnitTestRunner.php
Executes the PHPUnit command.

File

core/tests/Drupal/TestTools/Extension/DeprecationBridge/DeprecationHandler.php, line 63

Class

DeprecationHandler
Drupal's PHPUnit extension to manage code deprecation.

Namespace

Drupal\TestTools\Extension\DeprecationBridge

Code

public static function getConfiguration() : array|false {
    $environmentVariable = getenv('SYMFONY_DEPRECATIONS_HELPER');
    if ($environmentVariable === 'disabled') {
        return FALSE;
    }
    if ($environmentVariable === FALSE) {
        // Ensure ignored deprecation patterns listed in .deprecation-ignore.txt
        // are considered in testing.
        $relativeFilePath = __DIR__ . "/../../../../../.deprecation-ignore.txt";
        $deprecationIgnoreFilename = realpath($relativeFilePath);
        if (empty($deprecationIgnoreFilename)) {
            throw new \InvalidArgumentException(sprintf('The ignoreFile "%s" does not exist.', $relativeFilePath));
        }
        $environmentVariable = "ignoreFile={$deprecationIgnoreFilename}";
    }
    parse_str($environmentVariable, $configuration);
    return $configuration;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.