src/FS/File/JSON/Reader.php
public function read( $asArray = NULL )
	{
		$json	= FS_File_Reader::load( $this->filePath );
		$data	= json_decode( $json, $asArray );
		if( json_last_error() !== JSON_ERROR_NONE ){
			$message	= 'Decoding JSON failed (%s): %s';
			$message	= vsprintf( $message, array(
				ADT_Constant::getKeyByValue( 'JSON_ERROR_', json_last_error() ),
				json_last_error_msg()
			) );
			throw new RuntimeException( $message, json_last_error() );
		}
		return $data;
	}
public function read( $asArray = NULL )
	{
		$json	= FS_File_Reader::load( $this->filePath );
		$data	= json_decode( $json, $asArray );
		if( json_last_error() !== JSON_ERROR_NONE ){
			$message	= 'Decoding JSON failed (%s): %s';
			$message	= vsprintf( $message, array(
				ADT_Constant::getKeyByValue( 'JSON_ERROR_', json_last_error() ),
				json_last_error_msg()
			) );
			throw new RuntimeException( $message, json_last_error() );
		}
		return $data;
	}
public function read ( $ asArray = NULL ) { $ json = FS_File_Reader :: load ( $ this -> filePath ) ; $ data = json_decode ( $ json , $ asArray ) ; if ( json_last_error ( ) !== JSON_ERROR_NONE ) { $ message = 'Decoding JSON failed (%s): %s' ; $ message = vsprintf ( $ message , array ( ADT_Constant :: getKeyByValue ( 'JSON_ERROR_' , json_last_error ( ) ) , json_last_error_msg ( ) ) ) ; throw new RuntimeException ( $ message , json_last_error ( ) ) ; } return $ data ; }
Reads the JSON file to an object or array.
@access		public
@param		bool		$asArray		Flag: read into an array
@return		object|array
@throws		RuntimeException			if parsing failed
Reads the JSON file to an object or array .