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

Breadcrumb

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

function GlobalState::exportVariable

3 calls to GlobalState::exportVariable()
GlobalState::getConstantsAsString in vendor/phpunit/phpunit/src/Util/GlobalState.php
GlobalState::getGlobalsAsString in vendor/phpunit/phpunit/src/Util/GlobalState.php
GlobalState::getIniSettingsAsString in vendor/phpunit/phpunit/src/Util/GlobalState.php

File

vendor/phpunit/phpunit/src/Util/GlobalState.php, line 256

Class

GlobalState
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit

Namespace

PHPUnit\Util

Code

private static function exportVariable(mixed $variable) : string {
    if (is_scalar($variable) || $variable === null || is_array($variable) && self::arrayOnlyContainsScalars($variable)) {
        return var_export($variable, true);
    }
    return 'unserialize(' . var_export(serialize($variable), true) . ')';
}
RSS feed
Powered by Drupal