public function getDataAsJsonString($option = 0, $depth = 512): string
    {
        $data = $this->get();

        if (\is_object($data) || \is_array($data)) {
            $data = \json_encode($data, $option, $depth);
        } else {
            $data = \json_encode([$data], $option, $depth);
        }

        return \json_encode($data, $option, $depth);
    }
public function getDataAsJsonString($option = 0, $depth = 512): string
    {
        $data = $this->get();

        if (\is_object($data) || \is_array($data)) {
            $data = \json_encode($data, $option, $depth);
        } else {
            $data = \json_encode([$data], $option, $depth);
        }

        return \json_encode($data, $option, $depth);
    }
public function getDataAsJsonString ( $ option = 0 , $ depth = 512 ) : string { $ data = $ this -> get ( ) ; if ( \ is_object ( $ data ) || \ is_array ( $ data ) ) { $ data = \ json_encode ( $ data , $ option , $ depth ) ; } else { $ data = \ json_encode ( [ $ data ] , $ option , $ depth ) ; } return \ json_encode ( $ data , $ option , $ depth ) ; }
Return the data as a well-formatted string.
Any scalar value will be casted to an array
@param int $option \json_encode() options
@param int $depth \json_encode() depth
@return string
Return the data as a well - formatted string . Any scalar value will be casted to an array