Skip to content

Commit

Permalink
Rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Dec 5, 2023
1 parent fb1789f commit cf52ea4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Util/Exporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ final class Exporter
{
public static function export(mixed $value, bool $exportObjects = false): string
{
if (self::isScalarOrNullOrArrayOfScalars($value) || $exportObjects) {
if (self::isExportable($value) || $exportObjects) {
return (new \SebastianBergmann\Exporter\Exporter)->export($value);
}

return '{enable export of objects to see this value}';
}

private static function isScalarOrNullOrArrayOfScalars(mixed &$value, Context $context = null): bool
private static function isExportable(mixed &$value, Context $context = null): bool
{
if (is_scalar($value) || $value === null) {
return true;
Expand All @@ -49,7 +49,7 @@ private static function isScalarOrNullOrArrayOfScalars(mixed &$value, Context $c
$context->add($value);

foreach ($array as &$_value) {
if (!self::isScalarOrNullOrArrayOfScalars($_value, $context)) {
if (!self::isExportable($_value, $context)) {
return false;
}
}
Expand Down

0 comments on commit cf52ea4

Please sign in to comment.