src/AbstractJsonEncoder.php
protected function resolveValue($value)
    {
        do {
            if ($value instanceof \JsonSerializable) {
                $value = $value->jsonSerialize();
            } elseif ($value instanceof \Closure) {
                $value = $value();
            } else {
                break;
            }
        } while (true);

        return $value;
    }
protected function resolveValue($value)
    {
        do {
            if ($value instanceof \JsonSerializable) {
                $value = $value->jsonSerialize();
            } elseif ($value instanceof \Closure) {
                $value = $value();
            } else {
                break;
            }
        } while (true);

        return $value;
    }
protected function resolveValue ( $ value ) { do { if ( $ value instanceof \ JsonSerializable ) { $ value = $ value -> jsonSerialize ( ) ; } elseif ( $ value instanceof \ Closure ) { $ value = $ value ( ) ; } else { break ; } } while ( true ) ; return $ value ; }
Resolves the actual value of any given value that is about to be processed.
@param mixed $value The value to resolve
@return mixed The resolved value
Resolves the actual value of any given value that is about to be processed .