| @@ -1,21 +1,21 @@ | ||
| 1 | -<?php | |
| 2 | - | |
| 3 | -namespace FL\Assistant\Helpers; | |
| 4 | - | |
| 5 | -class JsonHelper { | |
| 6 | - | |
| 7 | - /** | |
| 8 | - * @param string $string | |
| 9 | - * @return bool | |
| 10 | - */ | |
| 11 | - public static function is_string_json( $string ) { | |
| 12 | - | |
| 13 | - if ( ! is_string( $string ) || trim( $string ) === '' ) { | |
| 14 | - return false; | |
| 15 | - } | |
| 16 | - | |
| 17 | - $decoded = json_decode( $string ); | |
| 18 | - | |
| 19 | - return is_object( $decoded ) || is_array( $decoded ); | |
| 20 | - } | |
| 21 | -} | |
| 1 | +<?php | |
| 2 | + | |
| 3 | +namespace FL\Assistant\Helpers; | |
| 4 | + | |
| 5 | +class JsonHelper { | |
| 6 | + | |
| 7 | + /** | |
| 8 | + * @param string $string | |
| 9 | + * @return bool | |
| 10 | + */ | |
| 11 | + public static function is_string_json( $string ) { | |
| 12 | + | |
| 13 | + if ( ! is_string( $string ) || trim( $string ) === '' ) { | |
| 14 | + return false; | |
| 15 | + } | |
| 16 | + | |
| 17 | + $decoded = json_decode( $string ); | |
| 18 | + | |
| 19 | + return is_object( $decoded ) || is_array( $decoded ); | |
| 20 | + } | |
| 21 | +} | |