Skip to content

Commit 586db71

Browse files
committed
Fix code in the example to be more copy-paste ready.
1 parent 5e1b5e9 commit 586db71

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

tests/example.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
require_once __DIR__ . '/../vendor/autoload.php';
1010

1111
/*/ The PSR Request and Response objects are usually provided by your framework /*/
12-
$request = Laminas\Diactoros\ServerRequestFactory::fromGlobals($_SERVER, $_GET, $_POST, $_COOKIE, $_FILES);
12+
$request = \Laminas\Diactoros\ServerRequestFactory::fromGlobals($_SERVER, $_GET, $_POST, $_COOKIE, $_FILES);
1313
$response = new \Laminas\Diactoros\Response();
1414

1515
/*/ The User (ID) is usually also provided by an entity in your framework /*/
@@ -35,19 +35,19 @@
3535
$encryptionKey = file_get_contents($keyPath . '/encryption.key');
3636
$privateKey = file_get_contents($keyPath . '/private.key');
3737

38-
$config = (new Pdsinterop\Solid\Auth\Factory\ConfigFactory(
38+
$config = (new \Pdsinterop\Solid\Auth\Factory\ConfigFactory(
3939
$clientIdentifier,
4040
$clientSecret,
4141
$encryptionKey,
42-
$privateKey
42+
$privateKey,
4343
[/* @FIXME: Server config keys go here */]
4444
))->create();
4545

46-
$authorizationServer = (new Pdsinterop\Solid\Auth\Factory\AuthorizationServerFactory($config))->create();
46+
$authorizationServer = (new \Pdsinterop\Solid\Auth\Factory\AuthorizationServerFactory($config))->create();
4747

4848
$user = null;
4949
if ($userId !== '') {
50-
$user = new Pdsinterop\Solid\Auth\Entity\User();
50+
$user = new \Pdsinterop\Solid\Auth\Entity\User();
5151
$user->setIdentifier($userId);
5252
}
5353

@@ -61,11 +61,11 @@
6161
switch ($request->getMethod() . $request->getUri()) {
6262
// @CHECKME: Do we also need 'GET/.well-known/oauth-authorization-server'?
6363
case 'GET/.well-known/openid-configuration':
64-
$server->respondToWellKnowRequest();
64+
$response = $server->respondToWellKnownRequest();
6565
break;
6666

6767
case 'POST/access_token':
68-
$server->respondToAccessTokenRequest($request);
68+
$response = $server->respondToAccessTokenRequest($request);
6969
break;
7070

7171
case 'GET/authorize':

0 commit comments

Comments
 (0)