@param json $json

@return false|array
197121
public function getData($json)
    {
        $data = json_decode($json, true);

        if ($data === null) {
            FieldManager::error('Could not parse JSON data - {error}.', ['error' => json_last_error_msg()]);

            return false;
        }

        return $data;
    }
230037
public function fromJson($json) {
    Helpers::checkType('json', 'string', $json);
    $decoded_value = json_decode($json);
    if ($decoded_value === null && ($json !== 'null' || $json !== '')) {
      throw new \Exception('Invalid JSON.');
    }
    return $this->setValue($decoded_value);
  }
402192
public function isValid($json=null) {
			if (empty($json) || ctype_space($json)) return false;
			json_decode($json);
			return (json_last_error() === JSON_ERROR_NONE);
		}
743438
public function dontSeeResponseContainsJson($json = [])
    {
        $jsonResponseArray = new JsonArray($this->connectionModule->_getResponseContent());
        $this->assertFalse(
            $jsonResponseArray->containsArray($json),
            "Response JSON contains provided JSON\n"
            . "- <info>" . var_export($json, true) . "</info>\n"
            . "+ " . var_export($jsonResponseArray->toArray(), true)
        );
    }
186328
public static function fromJson($json)
    {
        $responseData = json_decode($json, true);

        if (! $responseData) {
            return new Response(false, ['invalid-json']);
        }

        if (isset($responseData['success']) && $responseData['success'] == true) {
            return new Response(true);
        }

        if (isset($responseData['error-codes']) && is_array($responseData['error-codes'])) {
            return new Response(false, $responseData['error-codes']);
        }

        return new Response(false);
    }
441310
public static function error($json)
    {
        $fields = Deserialize::_fromJson($json);

        $result = new Api\Error();
        $result->setCode($fields->code);
        $result->setText($fields->text);

        return $result;
    }
224122
protected function compressInlineJsonCode($json)
    {
        if (!($json = (string) $json)) {
            return $json; // Nothing to do.
        }
        if (($compressed_json = \WebSharks\JsMinifier\Core::compress($json))) {
            return '/*<![CDATA[*/'.$compressed_json.'/*]]>*/';
        }
        return $json;
    }
1185232
public function parseJson($json)
    {
        $this->mentionName = $json['mention_name'];
        $this->id = $json['id'];
        $this->name = $json['name'];
        if (isset($json['links'])) {
            $this->links = $json['links'];
        }
        if(isset($json['xmpp_jid'])) {
            $this->xmppJid = $json['xmpp_jid'];
            $this->deleted = $json['is_deleted'];
            $this->lastActive = $json['last_active'];
            $this->title = $json['title'];
            $this->created = new \Datetime($json['created']);
            $this->groupAdmin = $json['is_group_admin'];
            $this->timezone = $json['timezone'];
            $this->guest = $json['is_guest'];
            $this->email = $json['email'];
            $this->photoUrl = $json['photo_url'];
        }
    }
863330
public static function fromJson($json)
    {
        $responseData = json_decode($json, true);

        if ( ! $responseData)
            return new static(false, [ResponseV3::E_INVALID_JSON]);

        return static::fromArray($responseData);
    }
727590
protected function json( $value )
	{
		if( !is_string( $value ) || '' === $value ){
			return false;
		}
		json_decode( $value );
		return (json_last_error() === JSON_ERROR_NONE);
	}
540145
public function decode(string $json): array
    {
        $decoded = \json_decode($json, true);
        if (\json_last_error() !== JSON_ERROR_NONE) {
            throw new DecodingException(\json_last_error_msg(), \json_last_error());
        }
        return $decoded;
    }
650379
public function checkSyntax($json)
    {
        $parser = new JsonParser;

        if (($result = $parser->lint($json)) instanceof ParsingException) {
            throw $result;
        }
    }
1019408
public function summarize($json = false)
    {
        $attributes = [
            'id' => $this->getKey(),
            'name' => $this->getAttribute('name'),
            'type' => $this->getAttribute('type'),
            'meta' => $this->present()->metaDescription,
            'thumbnail' => $this->present()->thumbnail,
            'preview' => ($this->type === 'image') ? $this->present()->filteredImageWith('rcompact') : ''
        ];

        foreach ($this->translations as $translation)
        {
            $attributes[$translation->locale] = [
                'caption' => $translation->caption,
                'description' => $translation->description,
                'alttext' => $translation->alttext
            ];
        }

        return $json ? json_encode($attributes) : $attributes;
    }
331041
public function generate(string $name, $json): bool
    {
        $this->json = $json;
        $this->name = $this->normalizeName($name);

        if (!$this->canGenerate()) {
            return false;
        }

        $view      = $this->getView();
        $variables = $this->getVariables();

        $path = $this->getPath();
        if (file_exists($path)) {
            unlink($path);
        }
        $this->fileService->render($view, $path, $variables);

        return true;
    }
400871
protected function isPaginated(array $json)
    {
        if (!array_key_exists('links', $json) || !array_key_exists('meta', $json)) {
            return false;
        }
        if (is_array($json['links'])
            && array_key_exists('self', $json['links'])
            && array_key_exists('first', $json['links'])
            && array_key_exists('last', $json['links'])
            && isset($json['meta']['pagination'])
            && is_array($json['meta']['pagination'])
            && array_key_exists('total', $json['meta']['pagination'])
            && array_key_exists('count', $json['meta']['pagination'])
            && array_key_exists('per_page', $json['meta']['pagination'])
            && array_key_exists('current_page', $json['meta']['pagination'])
            && array_key_exists('total_pages', $json['meta']['pagination'])
        ) {
            return true;
        }
        return false;
    }
618781
public function setJson($json)
    {
        global $CFG, $PDOX;

        $q = $PDOX->queryDie("UPDATE {$CFG->dbprefix}{$this->TABLE_NAME}
                SET json = :SET WHERE $this->PRIMARY_KEY = :PK",
            array(":SET" => $json, ":PK" => $this->id)
        );
    }
388322
public static function fromJson($json) {
        if (!$json) {
            $json = array();
        }

        if (!is_array($json)) {
            if (is_object($json)) {
                $json = (array) $json;
            } elseif (is_string($json)) {
                $json = json_decode(trim($json) ? $json : '{}', true);
            } else {
                throw new \InvalidArgumentException("JSON must be a string, an array or an object ('" . gettype($json) . "' provided).");
            }
        }

        return new Link(
            isset($json['href'])        ? $json['href']            : null,
            isset($json['templated'])    ? $json['templated']    : null,
            isset($json['type'])        ? $json['type']            : null,
            isset($json['deprecation'])    ? $json['deprecation']    : null,
            isset($json['name'])        ? $json['name']            : null,
            isset($json['profile'])        ? $json['profile']        : null,
            isset($json['title'])        ? $json['title']        : null,
            isset($json['hreflang'])    ? $json['hreflang']        : null
        );
    }