Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/4242' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
10 changes: 5 additions & 5 deletions src/Decoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class Decoder
*
* @param string $source String source to decode
* @param int $decodeType How objects should be decoded -- see
* {@link Zend_Json::TYPE_ARRAY} and {@link Zend_Json::TYPE_OBJECT} for
* {@link Zend\Json\Json::TYPE_ARRAY} and {@link Zend\Json\Json::TYPE_OBJECT} for
* valid values
* @throws InvalidArgumentException
* @return void
Expand Down Expand Up @@ -120,15 +120,15 @@ protected function __construct($source, $decodeType)
* - array of one or more of the above types
*
* By default, decoded objects will be returned as associative arrays; to
* return a stdClass object instead, pass {@link Zend_Json::TYPE_OBJECT} to
* return a stdClass object instead, pass {@link Zend\Json\Json::TYPE_OBJECT} to
* the $objectDecodeType parameter.
*
* @static
* @access public
* @param string $source String to be decoded
* @param int $objectDecodeType How objects should be decoded; should be
* either or {@link Zend_Json::TYPE_ARRAY} or
* {@link Zend_Json::TYPE_OBJECT}; defaults to TYPE_ARRAY
* either or {@link Zend\Json\Json::TYPE_ARRAY} or
* {@link Zend\Json\Json::TYPE_OBJECT}; defaults to TYPE_ARRAY
* @return mixed
*/
public static function decode($source, $objectDecodeType = Json::TYPE_OBJECT)
Expand Down Expand Up @@ -166,7 +166,7 @@ protected function _decodeValue()
* Decodes an object of the form:
* { "attribute: value, "attribute2" : value,...}
*
* If Zend_Json_Encoder was used to encode the original object then
* If Zend\Json\Encoder was used to encode the original object then
* a special attribute called __className which specifies a class
* name that should wrap the data contained within the encoded source.
*
Expand Down
12 changes: 6 additions & 6 deletions src/Expr.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@
namespace Zend\Json;

/**
* Class for Zend_Json encode method.
* Class for Zend\Json\Json encode method.
*
* This class simply holds a string with a native Javascript Expression,
* so objects | arrays to be encoded with Zend_Json can contain native
* so objects | arrays to be encoded with Zend\Json\Json can contain native
* Javascript Expressions.
*
* Example:
* <code>
* $foo = array(
* 'integer' =>9,
* 'string' =>'test string',
* 'function' => Zend_Json_Expr(
* 'function() { window.alert("javascript function encoded by Zend_Json") }'
* 'function' => Zend\Json\Expr(
* 'function() { window.alert("javascript function encoded by Zend\Json\Json") }'
* ),
* );
*
* Zend_Json::encode($foo, false, array('enableJsonExprFinder' => true));
* Zend\Json\Json::encode($foo, false, array('enableJsonExprFinder' => true));
* // it will returns json encoded string:
* // {"integer":9,"string":"test string","function":function() {window.alert("javascript function encoded by Zend_Json")}}
* // {"integer":9,"string":"test string","function":function() {window.alert("javascript function encoded by Zend\Json\Json")}}
* </code>
*/
class Expr
Expand Down
24 changes: 12 additions & 12 deletions src/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Json
*
* @param string $encodedValue Encoded in JSON format
* @param int $objectDecodeType Optional; flag indicating how to decode
* objects. See {@link Zend_Json_Decoder::decode()} for details.
* objects. See {@link Zend\Json\Decoder::decode()} for details.
* @return mixed
* @throws RuntimeException
*/
Expand Down Expand Up @@ -85,10 +85,10 @@ public static function decode($encodedValue, $objectDecodeType = self::TYPE_OBJE
*
* NOTE: Only public variables will be encoded
*
* NOTE: Encoding native javascript expressions are possible using Zend_Json_Expr.
* NOTE: Encoding native javascript expressions are possible using Zend\Json\Expr.
* You can enable this by setting $options['enableJsonExprFinder'] = true
*
* @see Zend_Json_Expr
* @see Zend\Json\Expr
*
* @param mixed $valueToEncode
* @param bool $cycleCheck Optional; whether or not to check for object recursion; off by default
Expand All @@ -105,7 +105,7 @@ public static function encode($valueToEncode, $cycleCheck = false, $options = ar
}
}

// Pre-encoding look for Zend_Json_Expr objects and replacing by tmp ids
// Pre-encoding look for Zend\Json\Expr objects and replacing by tmp ids
$javascriptExpressions = array();
if (isset($options['enableJsonExprFinder'])
&& ($options['enableJsonExprFinder'] == true)
Expand All @@ -123,7 +123,7 @@ public static function encode($valueToEncode, $cycleCheck = false, $options = ar
$encodedResult = Encoder::encode($valueToEncode, $cycleCheck, $options);
}

//only do post-processing to revert back the Zend_Json_Expr if any.
//only do post-processing to revert back the Zend\Json\Expr if any.
if (count($javascriptExpressions) > 0) {
$count = count($javascriptExpressions);
for ($i = 0; $i < $count; $i++) {
Expand All @@ -143,9 +143,9 @@ public static function encode($valueToEncode, $cycleCheck = false, $options = ar
}

/**
* Check & Replace Zend_Json_Expr for tmp ids in the valueToEncode
* Check & Replace Zend\Json\Expr for tmp ids in the valueToEncode
*
* Check if the value is a Zend_Json_Expr, and if replace its value
* Check if the value is a Zend\Json\Expr, and if replace its value
* with a magic key and save the javascript expression in an array.
*
* NOTE this method is recursive.
Expand Down Expand Up @@ -186,9 +186,9 @@ protected static function _recursiveJsonExprFinder(
* Return the value of an XML attribute text or the text between
* the XML tags
*
* In order to allow Zend_Json_Expr from xml, we check if the node
* matches the pattern that try to detect if it is a new Zend_Json_Expr
* if it matches, we return a new Zend_Json_Expr instead of a text node
* In order to allow Zend\Json\Expr from xml, we check if the node
* matches the pattern that try to detect if it is a new Zend\Json\Expr
* if it matches, we return a new Zend\Json\Expr instead of a text node
*
* @param SimpleXMLElement $simpleXmlElementObject
* @return Expr|string
Expand Down Expand Up @@ -298,7 +298,7 @@ protected static function _processXml($simpleXmlElementObject, $ignoreXmlAttribu
* calling a recursive (protected static) function in this class. Then, it
* converts that PHP array into JSON by calling the "encode" static function.
*
* NOTE: Encoding native javascript expressions via Zend_Json_Expr is not possible.
* NOTE: Encoding native javascript expressions via Zend\Json\Expr is not possible.
*
* @static
* @access public
Expand All @@ -323,7 +323,7 @@ public static function fromXml($xmlStringContents, $ignoreXmlAttributes = true)
// Call the recursive function to convert the XML into a PHP array.
$resultArray = static::_processXml($simpleXmlElementObject, $ignoreXmlAttributes);

// Convert the PHP array to JSON using Zend_Json encode method.
// Convert the PHP array to JSON using Zend\Json\Json encode method.
// It is just that simple.
$jsonStringOutput = static::encode($resultArray);
return($jsonStringOutput);
Expand Down
2 changes: 1 addition & 1 deletion src/Server/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Zend\Stdlib\ErrorHandler;

/**
* Zend_Json_Server_Cache: cache Zend_Json_Server server definition and SMD
* Zend\Json\Server\Cache: cache Zend\Json\Server\Server server definition and SMD
*/
class Cache extends ServerCache
{
Expand Down
2 changes: 1 addition & 1 deletion src/Server/Exception/HttpException.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace Zend\Json\Server\Exception;

/**
* Thrown by Zend_Json_Server_Client when an HTTP error occurs during an
* Thrown by Zend\Json\Server\Client when an HTTP error occurs during an
* JSON-RPC method call.
*/
class HttpException extends RuntimeException
Expand Down

0 comments on commit 3ef3347

Please sign in to comment.