lib/ChrisCollins/GeneralUtils/Json/JsonCodec.php
public function encode($value, $optionsMask = 0)
    {
        $encoded = json_encode($value, $optionsMask);

        $lastError = json_last_error();

        if ($lastError !== JSON_ERROR_NONE) {
            throw new JsonException($this->translateErrorMessage($lastError));
        }

        return $encoded;
    }
public function encode($value, $optionsMask = 0)
    {
        $encoded = json_encode($value, $optionsMask);

        $lastError = json_last_error();

        if ($lastError !== JSON_ERROR_NONE) {
            throw new JsonException($this->translateErrorMessage($lastError));
        }

        return $encoded;
    }
public function encode ( $ value , $ optionsMask = 0 ) { $ encoded = json_encode ( $ value , $ optionsMask ) ; $ lastError = json_last_error ( ) ; if ( $ lastError !== JSON_ERROR_NONE ) { throw new JsonException ( $ this -> translateErrorMessage ( $ lastError ) ) ; } return $ encoded ; }
Encode a PHP value as a JSON string.

@param mixed $value The value to encode.
@param int $optionsMask A bitmask of options (see PHP's json_encode function for acceptable values).

@return string A JSON string.

@todo Support the depth parameter when PHP 5.5 is more prevalent.
Encode a PHP value as a JSON string .