@param string $jsonString

@return AccessToken
426505
public static function fromJson($jsonString)
    {
        $tokenData = \json_decode($jsonString, true);
        if (null === $tokenData && JSON_ERROR_NONE !== \json_last_error()) {
            $errorMsg = \function_exists('json_last_error_msg') ? \json_last_error_msg() : \json_last_error();
            throw new AccessTokenException(\sprintf('unable to decode JSON from storage: %s', $errorMsg));
        }

        return new self($tokenData);
    }
1286345
public function parseJson($jsonString)
    {
        $stopWords = [];

        $decodedResponse = json_decode($jsonString);

        if (isset($decodedResponse->wordSet->managedList)) {
            $stopWords = (array)$decodedResponse->wordSet->managedList;
        }

        return $stopWords;
    }
1034082
public static function decode($string)
    {
        if (! is_string($string)) {
            throw new JsonException('Json decode parameter must be a string');
        }

        $result = json_decode($string, true);

        if ($result === null) {
            throw new JsonException('Json decode error');
        }
        return $result;
    }
1278666
function oAuthParseResponse($responseString) {
    $r = array();
    foreach (explode('&', $responseString) as $param) {
      $pair = explode('=', $param, 2);
      if (count($pair) != 2) continue;
      $r[urldecode($pair[0])] = urldecode($pair[1]);
    }
    return $r;
  }
1012838
public function validateAccessToken($accessToken)
    {
        $keys        = $this->getJwtVerificationKeys();
        $tokenClaims = (array)JWT::decode($accessToken, $keys, ['RS256']);

        if ($this->getClientId() != $tokenClaims['aud'] && $this->getClientId() != $tokenClaims['appid']) {
            throw new \RuntimeException('The client_id / audience is invalid!');
        }
        if ($tokenClaims['nbf'] > time() || $tokenClaims['exp'] < time()) {
            // Additional validation is being performed in firebase/JWT itself
            throw new \RuntimeException('The id_token is invalid!');
        }

        if ('common' == $this->tenant) {
            $this->tenant = $tokenClaims['tid'];

            $tenant = $this->getTenantDetails($this->tenant);
            if ($tokenClaims['iss'] != $tenant['issuer']) {
                throw new \RuntimeException('Invalid token issuer!');
            }
        } else {
            $tenant = $this->getTenantDetails($this->tenant);
            if ($tokenClaims['iss'] != $tenant['issuer']) {
                throw new \RuntimeException('Invalid token issuer!');
            }
        }

        return $tokenClaims;
    }
550110
public function loadJSON(string $jsonString):void {
		$json = json_decode($jsonString);

		foreach($json as $key => $value) {
			$node = $this->createElement($key, $value);
			$this->appendChild($node);
		}
	}
1050312
public static <T> T withJsonString(String jsonString,
            TypeReference<T> typeReference) {
        return withBytes(jsonString.getBytes(), typeReference);
    }
1077199
public function parseJson($jsonString)
    {
        $decodedResponse = json_decode($jsonString);
        $schemaResponse = $decodedResponse->schema;

        $schema = GeneralUtility::makeInstance(Schema::class);

        if ($schemaResponse === null) {
            return $schema;
        }

        $language = $this->parseLanguage($schemaResponse);
        $schema->setLanguage($language);

        $name = $this->parseName($schemaResponse);
        $schema->setName($name);

        return $schema;
    }
242066
private function createToken($jsonData)
    {
        $content = json_decode($jsonData, true);

        if (!is_array($content)) {
            throw new TokenException(sprintf('Could not decode JSON string: "%s"', $jsonData));
        }

        return Token::create($content);
    }
913497
public static function jsonDecode($string)
    {
        if ($string) {
            $json = json_decode($string, true);
            // if json_decode failed
            if ($json === null) {
                self::jsonLastError();
            }
            return $json;
        } else {
            return false;
        }
    }
812143
public function theResponseShouldContainJson(PyStringNode $jsonString)
    {
        $etalon = json_decode($this->replacePlaceHolder($jsonString->getRaw()), true);
        $actual = json_decode($this->response->getBody(), true);

        if (null === $etalon) {
            throw new \RuntimeException(
              "Can not convert etalon to json:\n" . $this->replacePlaceHolder($jsonString->getRaw())
            );
        }

        if (null === $actual) {
            throw new \RuntimeException(
              "Can not convert actual to json:\n" . $this->replacePlaceHolder((string) $this->response->getBody())
            );
        }

        Assertions::assertGreaterThanOrEqual(count($etalon), count($actual));
        foreach ($etalon as $key => $needle) {
            Assertions::assertArrayHasKey($key, $actual);
            Assertions::assertEquals($etalon[$key], $actual[$key]);
        }
    }
447527
public function verify($openid, $jsonString, $jsonSignature)
    {
        $params = [
            'openid'         => $openid,
            'json_string'    => $jsonString,
            'json_signature' => $jsonSignature,
        ];

        return $this->parseJSON('json', [self::API_VERIFY_SIGNATURE, $params]);
    }
909036
public static function getPayload($token, $jsonDecode = true)
    {
        // Split parts
        list($payload, $signature) = explode('.', $token);

        // Decode first part
        $payloadJSON = base64_decode($payload);

        // Choose to decode or not
        if ($jsonDecode) {
            return json_decode($payloadJSON, true);
        }

        // Return json
        return $payloadJSON;
    }
123940
public static function generateToken($userName, $keyString) {
        $userNameCast = (string) $userName;
        $keyStringCast = (string) $keyString;
        $multiOtpObj = new MultiotpWrapper($keyStringCast);
        return $multiOtpObj->GenerateSmsToken($userNameCast);
    }
553902
public static function createFromJsonResponse($jsonString)
    {
        $data = json_decode($jsonString, true);

        $sourceImages = array_map(function ($sourceImage) {
            return SourceImage::createFromDecodedJsonResponse($sourceImage);
        }, $data['items']);

        $total = isset($data['total']) ? $data['total'] : 0;
        $links = isset($data['links']) ? $data['links'] : [];
        $cursor = isset($data['cursor']) ? $data['cursor'] : null;

        return new self($sourceImages, $total, $links, $cursor);
    }
982379
public static JSONObject getJSONFromString(final String jsonString) {
        if (isBlank(jsonString)) {
            return new JSONObject();
        }
        return JSON.parseObject(jsonString);
    }
574295
public function deserialize($jsonString, $className)
    {
        if (!$this->isValidClassName($className)) {
            throw new \Exception($className.' is not defined in OpenApi PHP Annotations');
        }
        return $this->doDeserialize(json_decode($jsonString), $className);
    }