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\UtilCode
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;
}