Skip to content

Commit 949f53b

Browse files
committed
Use logical operators
Closes #409
1 parent 36a5734 commit 949f53b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Middleware/OAuthMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function handle($request, Closure $next, $scopesString = null)
6969
*/
7070
public function validateScopes($scopes)
7171
{
72-
if (!empty($scopes) and !$this->authorizer->hasScope($scopes)) {
72+
if (!empty($scopes) && !$this->authorizer->hasScope($scopes)) {
7373
throw new InvalidScopeException(implode(',', $scopes));
7474
}
7575
}

src/Storage/FluentClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function get($clientId, $clientSecret = null, $redirectUri = null, $grant
9898
->where('oauth_client_endpoints.redirect_uri', $redirectUri);
9999
}
100100

101-
if ($this->limitClientsToGrants === true and !is_null($grantType)) {
101+
if ($this->limitClientsToGrants === true && !is_null($grantType)) {
102102
$query = $query->join('oauth_client_grants', 'oauth_clients.id', '=', 'oauth_client_grants.client_id')
103103
->join('oauth_grants', 'oauth_grants.id', '=', 'oauth_client_grants.grant_id')
104104
->where('oauth_grants.id', $grantType);

src/Storage/FluentScope.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ public function get($scope, $grantType = null, $clientId = null)
7474
->select('oauth_scopes.id as id', 'oauth_scopes.description as description')
7575
->where('oauth_scopes.id', $scope);
7676

77-
if ($this->limitClientsToScopes === true and !is_null($clientId)) {
77+
if ($this->limitClientsToScopes === true && !is_null($clientId)) {
7878
$query = $query->join('oauth_client_scopes', 'oauth_scopes.id', '=', 'oauth_client_scopes.scope_id')
7979
->where('oauth_client_scopes.client_id', $clientId);
8080
}
8181

82-
if ($this->limitScopesToGrants === true and !is_null($grantType)) {
82+
if ($this->limitScopesToGrants === true && !is_null($grantType)) {
8383
$query = $query->join('oauth_grant_scopes', 'oauth_scopes.id', '=', 'oauth_grant_scopes.scope_id')
8484
->join('oauth_grants', 'oauth_grants.id', '=', 'oauth_grant_scopes.grant_id')
8585
->where('oauth_grants.id', $grantType);

0 commit comments

Comments
 (0)