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

Breadcrumb

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

function Exporter::isExportable

1 call to Exporter::isExportable()
Exporter::export in vendor/phpunit/phpunit/src/Util/Exporter.php

File

vendor/phpunit/phpunit/src/Util/Exporter.php, line 34

Class

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

Namespace

PHPUnit\Util

Code

private static function isExportable(mixed &$value, ?Context $context = null) : bool {
    if (is_scalar($value) || $value === null) {
        return true;
    }
    if (!is_array($value)) {
        return false;
    }
    if (!$context) {
        $context = new Context();
    }
    if ($context->contains($value) !== false) {
        return true;
    }
    $array = $value;
    $context->add($value);
    foreach ($array as &$_value) {
        if (!self::isExportable($_value, $context)) {
            return false;
        }
    }
    return true;
}
RSS feed
Powered by Drupal