public static function getStringValueAsCode($value): string
    {
        if ($value instanceof \DateTime) {
            return "new \DateTime('".$value->format(self::DEFAULT_DATETIME_FORMAT)."')";
        } elseif (is_bool($value)) {
            return $value ? 'true' : 'false';
        } elseif (is_array($value)) {
            return '['.implode(', ', array_map('self::getStringValueAsCode', array_filter($value))).']';
        } elseif (is_null($value)) {
            return 'null';
        } elseif (is_int($value) || is_float($value)) {
            return (string) $value;
        }

        return "'".(string) $value."'";
    }
public static function getStringValueAsCode($value): string
    {
        if ($value instanceof \DateTime) {
            return "new \DateTime('".$value->format(self::DEFAULT_DATETIME_FORMAT)."')";
        } elseif (is_bool($value)) {
            return $value ? 'true' : 'false';
        } elseif (is_array($value)) {
            return '['.implode(', ', array_map('self::getStringValueAsCode', array_filter($value))).']';
        } elseif (is_null($value)) {
            return 'null';
        } elseif (is_int($value) || is_float($value)) {
            return (string) $value;
        }

        return "'".(string) $value."'";
    }
public static function getStringValueAsCode ( $ value ) : string { if ( $ value instanceof \ DateTime ) { return "new \DateTime('" . $ value -> format ( self :: DEFAULT_DATETIME_FORMAT ) . "')" ; } elseif ( is_bool ( $ value ) ) { return $ value ? 'true' : 'false' ; } elseif ( is_array ( $ value ) ) { return '[' . implode ( ', ' , array_map ( 'self::getStringValueAsCode' , array_filter ( $ value ) ) ) . ']' ; } elseif ( is_null ( $ value ) ) { return 'null' ; } elseif ( is_int ( $ value ) || is_float ( $ value ) ) { return ( string ) $ value ; } return "'" . ( string ) $ value . "'" ; }
Get string display output for showing code based on the value.

@param mixed $value
@return string
Get string display output for showing code based on the value .