Skip to content

Commit fd08d5a

Browse files
authored
chore(docs): clean up README (#332)
1 parent d7cd1db commit fd08d5a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ composer require firebase/php-jwt
1919
Example
2020
-------
2121
```php
22-
<?php
23-
use \Firebase\JWT\JWT;
22+
use Firebase\JWT\JWT;
2423

2524
$key = "example_key";
2625
$payload = array(
@@ -57,14 +56,11 @@ $decoded_array = (array) $decoded;
5756
*/
5857
JWT::$leeway = 60; // $leeway in seconds
5958
$decoded = JWT::decode($jwt, $key, array('HS256'));
60-
61-
?>
6259
```
6360
Example with RS256 (openssl)
6461
----------------------------
6562
```php
66-
<?php
67-
use \Firebase\JWT\JWT;
63+
use Firebase\JWT\JWT;
6864

6965
$privateKey = <<<EOD
7066
-----BEGIN RSA PRIVATE KEY-----
@@ -112,13 +108,15 @@ $decoded = JWT::decode($jwt, $publicKey, array('RS256'));
112108

113109
$decoded_array = (array) $decoded;
114110
echo "Decode:\n" . print_r($decoded_array, true) . "\n";
115-
?>
116111
```
117112

118113
Using JWKs
119114
----------
120115

121116
```php
117+
use Firebase\JWT\JWK;
118+
use Firebase\JWT\JWT;
119+
122120
// Set of keys. The "keys" key is required. For example, the JSON response to
123121
// this endpoint: https://www.gstatic.com/iap/verify/public_key-jwk
124122
$jwks = ['keys' => []];

0 commit comments

Comments
 (0)