   'phpDocumentor\Descriptor\FileDescriptor * hash ce82132b4df81f45e8030d0f5161a8be * pathPack/JsonPack.php	 * source<?php
/**
 * JsonPack
 *
 * @author camera360_server@camera360.com
 * @copyright Chengdu pinguo Technology Co.,Ltd.
 */

namespace PG\MSF\Pack;

use Exception;

/**
 * Class JsonPack
 * @package PG\MSF\Pack
 */
class JsonPack implements IPack
{
    /**
     * JSON打包
     *
     * @param mixed $data 待打包数据
     * @return string
     */
    public function pack($data)
    {
        return json_encode($data, JSON_UNESCAPED_UNICODE);
    }

    /**
     * JSON解包
     *
     * @param string $data 待解包数据
     * @return mixed
     * @throws Exception
     */
    public function unPack($data)
    {
        $value = json_decode($data);
        if (empty($value)) {
            throw new Exception('Json unPack失败');
        }
        return $value;
    }
}
 * namespaceAliases#phpDocumentor\Descriptor\Collection * items	Exception
\Exception * includes	  * constants	  * functions	 
 * classes	\PG\MSF\Pack\JsonPack(phpDocumentor\Descriptor\ClassDescriptor	 * parent * implements	\PG\MSF\Pack\IPack * abstract * final	  * properties	 
 * methods	pack)phpDocumentor\Descriptor\MethodDescriptor"	 * static * visibilitypublic * arguments	$data+phpDocumentor\Descriptor\ArgumentDescriptor	 * method" * types	 3phpDocumentor\Descriptor\Type\UnknownTypeDescriptor * namemixed
 * default  * byReference * isVariadic * fqsen$ * namespace 
 * package
 * summary * description待打包数据 * fileDescriptor  * line  * tags	 	 * errors	  * inheritedElement )\PG\MSF\Pack\JsonPack::pack()$* +,
JSON打包-/ 01	param	 ,phpDocumentor\Descriptor\Tag\ParamDescriptor * variableName""$6-.2	 return	 -phpDocumentor\Descriptor\Tag\ReturnDescriptor"	 .phpDocumentor\Descriptor\Type\StringDescriptor $9-2	 2	 3 unPack"	 !"0"	 ; & '()$* +,-待解包数据/ 0 1	 2	 3 )\PG\MSF\Pack\JsonPack::unPack()$<* +,
JSON解包-/ 0%1	6	 78""4$6-=2	 9	 :"	 #$%$9-2	 throws	 -phpDocumentor\Descriptor\Tag\ThrowsDescriptor"	 #$$@-2	 2	 3  * usedTraits	 )$JsonPack*\PG\MSF\Pack+PG\MSF\Pack,Class JsonPack-/" 01	package	 &phpDocumentor\Descriptor\TagDescriptor$G-E2	 
subpackage	 2	 3  * interfaces	 	 * traits	 
 * markers	 )$JsonPack.php* +Default,C-/ 0 1	author	 -phpDocumentor\Descriptor\Tag\AuthorDescriptor$O-camera360_server@camera360.com2	 	copyright	 H$R-"Chengdu pinguo Technology Co.,Ltd.2	 G	 H$G-N2	 I	 2	 3 