php/class-wp-cli.php
public static function read_value( $raw_value, $assoc_args = array() ) {
		if ( \WP_CLI\Utils\get_flag_value( $assoc_args, 'format' ) === 'json' ) {
			$value = json_decode( $raw_value, true );
			if ( null === $value ) {
				self::error( sprintf( 'Invalid JSON: %s', $raw_value ) );
			}
		} else {
			$value = $raw_value;
		}

		return $value;
	}
public static function read_value( $raw_value, $assoc_args = array() ) {
		if ( \WP_CLI\Utils\get_flag_value( $assoc_args, 'format' ) === 'json' ) {
			$value = json_decode( $raw_value, true );
			if ( null === $value ) {
				self::error( sprintf( 'Invalid JSON: %s', $raw_value ) );
			}
		} else {
			$value = $raw_value;
		}

		return $value;
	}
public static function read_value ( $ raw_value , $ assoc_args = array ( ) ) { if ( \ WP_CLI \ Utils \ get_flag_value ( $ assoc_args , 'format' ) === 'json' ) { $ value = json_decode ( $ raw_value , true ) ; if ( null === $ value ) { self :: error ( sprintf ( 'Invalid JSON: %s' , $ raw_value ) ) ; } } else { $ value = $ raw_value ; } return $ value ; }
Read a value, from various formats.

@access public
@category Input

@param mixed $value
@param array $assoc_args
Read a value from various formats .