From 3b17872f1066903cdd15f7b9131aabb8ab2fdacc Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Tue, 2 Dec 2014 11:54:45 +0100 Subject: [PATCH] Fix bad accesses and bad arguments. --- examples/relational/api.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/relational/api.php b/examples/relational/api.php index fededdf8..d331e972 100644 --- a/examples/relational/api.php +++ b/examples/relational/api.php @@ -59,11 +59,11 @@ $router->get('/users', function (Request $request) use ($server) { 'name' => $result['name'], ]; - if ($server->hasScope('email')) { + if ($server->getAccessToken()->hasScope('email')) { $user['email'] = $result['email']; } - if ($server->hasScope('photo')) { + if ($server->getAccessToken()->hasScope('photo')) { $user['photo'] = $result['photo']; } @@ -74,7 +74,7 @@ $router->get('/users', function (Request $request) use ($server) { }); // GET /users/{username} -$router->get('/users/{username}', function (Request $request, $args) use ($server) { +$router->get('/users/{username}', function (Request $request, Response $response, array $args) use ($server) { $result = (new Model\Users())->get($args['username']); @@ -87,11 +87,11 @@ $router->get('/users/{username}', function (Request $request, $args) use ($serve 'name' => $result[0]['name'], ]; - if ($server->hasScope('email')) { + if ($server->getAccessToken()->hasScope('email')) { $user['email'] = $result[0]['email']; } - if ($server->hasScope('photo')) { + if ($server->getAccessToken()->hasScope('photo')) { $user['photo'] = $result[0]['photo']; }