Skip to content

Commit 27179e1

Browse files
authored
docs: fix examples in README.md (#569)
1 parent 8f718f4 commit 27179e1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ $jwks = ['keys' => []];
291291

292292
// JWK::parseKeySet($jwks) returns an associative array of **kid** to Firebase\JWT\Key
293293
// objects. Pass this as the second parameter to JWT::decode.
294-
JWT::decode($payload, JWK::parseKeySet($jwks));
294+
JWT::decode($jwt, JWK::parseKeySet($jwks));
295295
```
296296

297297
Using Cached Key Sets
@@ -350,7 +350,7 @@ use InvalidArgumentException;
350350
use UnexpectedValueException;
351351

352352
try {
353-
$decoded = JWT::decode($payload, $keys);
353+
$decoded = JWT::decode($jwt, $keys);
354354
} catch (InvalidArgumentException $e) {
355355
// provided key/key-array is empty or malformed.
356356
} catch (DomainException $e) {
@@ -380,7 +380,7 @@ like this:
380380
use Firebase\JWT\JWT;
381381
use UnexpectedValueException;
382382
try {
383-
$decoded = JWT::decode($payload, $keys);
383+
$decoded = JWT::decode($jwt, $keys);
384384
} catch (LogicException $e) {
385385
// errors having to do with environmental setup or malformed JWT Keys
386386
} catch (UnexpectedValueException $e) {
@@ -395,7 +395,7 @@ instead, you can do the following:
395395

396396
```php
397397
// return type is stdClass
398-
$decoded = JWT::decode($payload, $keys);
398+
$decoded = JWT::decode($jwt, $keys);
399399

400400
// cast to array
401401
$decoded = json_decode(json_encode($decoded), true);

0 commit comments

Comments
 (0)