Skip to content

Commit

Permalink
minor #98 Fix continous integration checks (ajgarlag)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 0.4-dev branch.

Discussion
----------

Fix continous integration checks

- Fix coding standards check
- Fix static analysis check

Commits
-------

187a995 Fix continous integration checks
  • Loading branch information
chalasr committed Jun 21, 2022
2 parents 97c4c0a + 187a995 commit a442c6c
Show file tree
Hide file tree
Showing 15 changed files with 15 additions and 25 deletions.
6 changes: 3 additions & 3 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?xml version="1.0"?>
<psalm
totallyTyped="true"
forbidEcho="true"
errorLevel="1"
strictBinaryOperands="true"
phpVersion="7.1"
phpVersion="7.2"
allowStringToStandInForClass="true"
rememberPropertyAssignmentsAfterCall="false"
checkForThrowsInGlobalScope="true"
Expand All @@ -15,6 +14,7 @@
<projectFiles>
<directory name="src"/>
<ignoreFiles>
<file name="src/Security/Authenticator/ForwardCompatAuthenticatorTrait.php"/> <!-- @see https://github.com/vimeo/psalm/issues/7863 -->
<directory name="src/DependencyInjection"/>
<directory name="vendor"/>
</ignoreFiles>
Expand Down
2 changes: 0 additions & 2 deletions src/Controller/AuthorizationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace League\Bundle\OAuth2ServerBundle\Controller;

use League\Bundle\OAuth2ServerBundle\Converter\UserConverterInterface;
use League\Bundle\OAuth2ServerBundle\Event\AuthorizationRequestResolveEvent;
use League\Bundle\OAuth2ServerBundle\Event\AuthorizationRequestResolveEventFactory;
use League\Bundle\OAuth2ServerBundle\Manager\ClientManagerInterface;
use League\Bundle\OAuth2ServerBundle\Model\AbstractClient;
Expand Down Expand Up @@ -97,7 +96,6 @@ public function indexAction(Request $request): Response
}
}

/** @var AuthorizationRequestResolveEvent $event */
$event = $this->eventDispatcher->dispatch(
$this->eventFactory->fromAuthorizationRequest($authRequest),
OAuth2Events::AUTHORIZATION_REQUEST_RESOLVE
Expand Down
1 change: 0 additions & 1 deletion src/Controller/TokenController.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public function indexAction(Request $request): Response

$renderedResponse = $this->httpFoundationFactory->createResponse($response);

/** @var TokenRequestResolveEvent $event */
$event = $this->eventDispatcher->dispatch(
new TokenRequestResolveEvent($renderedResponse),
OAuth2Events::TOKEN_REQUEST_RESOLVE
Expand Down
2 changes: 1 addition & 1 deletion src/DBAL/Type/ImplodedArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private function assertValueCanBeImploded($value): void
return;
}

if (is_scalar($value)) {
if (\is_scalar($value)) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/LeagueOAuth2ServerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
use League\Bundle\OAuth2ServerBundle\Manager\Doctrine\RefreshTokenManager;
use League\Bundle\OAuth2ServerBundle\Manager\InMemory\AccessTokenManager as InMemoryAccessTokenManager;
use League\Bundle\OAuth2ServerBundle\Manager\ScopeManagerInterface;
use League\Bundle\OAuth2ServerBundle\ValueObject\Scope as ScopeModel;
use League\Bundle\OAuth2ServerBundle\Persistence\Mapping\Driver;
use League\Bundle\OAuth2ServerBundle\Security\Authenticator\OAuth2Authenticator;
use League\Bundle\OAuth2ServerBundle\Service\CredentialsRevoker\DoctrineCredentialsRevoker;
use League\Bundle\OAuth2ServerBundle\ValueObject\Scope as ScopeModel;
use League\OAuth2\Server\AuthorizationServer;
use League\OAuth2\Server\CryptKey;
use League\OAuth2\Server\Grant\AuthCodeGrant;
Expand Down
3 changes: 1 addition & 2 deletions src/Manager/Doctrine/ClientManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
use League\Bundle\OAuth2ServerBundle\Manager\ClientFilter;
use League\Bundle\OAuth2ServerBundle\Manager\ClientManagerInterface;
use League\Bundle\OAuth2ServerBundle\Model\AbstractClient;
use League\Bundle\OAuth2ServerBundle\OAuth2Events;
use League\Bundle\OAuth2ServerBundle\ValueObject\Grant;
use League\Bundle\OAuth2ServerBundle\ValueObject\RedirectUri;
use League\Bundle\OAuth2ServerBundle\ValueObject\Scope;
use League\Bundle\OAuth2ServerBundle\OAuth2Events;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;

final class ClientManager implements ClientManagerInterface
Expand Down Expand Up @@ -54,7 +54,6 @@ public function find(string $identifier): ?AbstractClient

public function save(AbstractClient $client): void
{
/** @var PreSaveClientEvent $event */
$event = $this->dispatcher->dispatch(new PreSaveClientEvent($client), OAuth2Events::PRE_SAVE_CLIENT);
$client = $event->getClient();

Expand Down
3 changes: 1 addition & 2 deletions src/Manager/InMemory/ClientManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
use League\Bundle\OAuth2ServerBundle\Manager\ClientFilter;
use League\Bundle\OAuth2ServerBundle\Manager\ClientManagerInterface;
use League\Bundle\OAuth2ServerBundle\Model\AbstractClient;
use League\Bundle\OAuth2ServerBundle\OAuth2Events;
use League\Bundle\OAuth2ServerBundle\ValueObject\Grant;
use League\Bundle\OAuth2ServerBundle\ValueObject\RedirectUri;
use League\Bundle\OAuth2ServerBundle\ValueObject\Scope;
use League\Bundle\OAuth2ServerBundle\OAuth2Events;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;

final class ClientManager implements ClientManagerInterface
Expand All @@ -38,7 +38,6 @@ public function find(string $identifier): ?AbstractClient

public function save(AbstractClient $client): void
{
/** @var PreSaveClientEvent $event */
$event = $this->dispatcher->dispatch(new PreSaveClientEvent($client), OAuth2Events::PRE_SAVE_CLIENT);
$client = $event->getClient();

Expand Down
3 changes: 0 additions & 3 deletions src/Persistence/Mapping/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
use League\Bundle\OAuth2ServerBundle\Model\AccessToken;
use League\Bundle\OAuth2ServerBundle\Model\AuthorizationCode;
use League\Bundle\OAuth2ServerBundle\Model\Client;
use League\Bundle\OAuth2ServerBundle\ValueObject\Grant;
use League\Bundle\OAuth2ServerBundle\ValueObject\RedirectUri;
use League\Bundle\OAuth2ServerBundle\Model\RefreshToken;
use League\Bundle\OAuth2ServerBundle\ValueObject\Scope;

/**
* Metadata driver that enables mapping dynamically accordingly to container configuration.
Expand Down
3 changes: 1 addition & 2 deletions src/Repository/ScopeRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
use League\Bundle\OAuth2ServerBundle\Manager\ClientManagerInterface;
use League\Bundle\OAuth2ServerBundle\Manager\ScopeManagerInterface;
use League\Bundle\OAuth2ServerBundle\Model\AbstractClient;
use League\Bundle\OAuth2ServerBundle\OAuth2Events;
use League\Bundle\OAuth2ServerBundle\ValueObject\Grant;
use League\Bundle\OAuth2ServerBundle\ValueObject\Scope;
use League\Bundle\OAuth2ServerBundle\OAuth2Events;
use League\OAuth2\Server\Entities\ClientEntityInterface;
use League\OAuth2\Server\Entities\ScopeEntityInterface;
use League\OAuth2\Server\Exception\OAuthServerException;
Expand Down Expand Up @@ -84,7 +84,6 @@ public function finalizeScopes(

$scopes = $this->setupScopes($client, $this->scopeConverter->toDomainArray(array_values($scopes)));

/** @var ScopeResolveEvent $event */
$event = $this->eventDispatcher->dispatch(
new ScopeResolveEvent(
$scopes,
Expand Down
3 changes: 1 addition & 2 deletions src/Repository/UserRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
use League\Bundle\OAuth2ServerBundle\Event\UserResolveEvent;
use League\Bundle\OAuth2ServerBundle\Manager\ClientManagerInterface;
use League\Bundle\OAuth2ServerBundle\Model\AbstractClient;
use League\Bundle\OAuth2ServerBundle\ValueObject\Grant;
use League\Bundle\OAuth2ServerBundle\OAuth2Events;
use League\Bundle\OAuth2ServerBundle\ValueObject\Grant;
use League\OAuth2\Server\Entities\ClientEntityInterface;
use League\OAuth2\Server\Entities\UserEntityInterface;
use League\OAuth2\Server\Repositories\UserRepositoryInterface;
Expand Down Expand Up @@ -54,7 +54,6 @@ public function getUserEntityByUserCredentials(
/** @var AbstractClient $client */
$client = $this->clientManager->find($clientEntity->getIdentifier());

/** @var UserResolveEvent $event */
$event = $this->eventDispatcher->dispatch(
new UserResolveEvent(
$username,
Expand Down
2 changes: 1 addition & 1 deletion src/Security/Authenticator/OAuth2Authenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function start(Request $request, AuthenticationException $authException =
*
* @return Passport
*/
public function doAuthenticate(Request $request) /*: Passport */
public function doAuthenticate(Request $request) /* : Passport */
{
try {
$psr7Request = $this->resourceServer->validateAuthenticatedRequest($this->httpMessageFactory->createRequest($request));
Expand Down
2 changes: 1 addition & 1 deletion tests/Acceptance/DoctrineClientManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
use League\Bundle\OAuth2ServerBundle\Model\AccessToken;
use League\Bundle\OAuth2ServerBundle\Model\Client;
use League\Bundle\OAuth2ServerBundle\Model\RefreshToken;
use League\Bundle\OAuth2ServerBundle\ValueObject\Scope;
use League\Bundle\OAuth2ServerBundle\Tests\Fixtures\FixtureFactory;
use League\Bundle\OAuth2ServerBundle\ValueObject\Scope;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Acceptance/InMemoryClientManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

use League\Bundle\OAuth2ServerBundle\Manager\InMemory\ClientManager as InMemoryClientManager;
use League\Bundle\OAuth2ServerBundle\Model\Client;
use League\Bundle\OAuth2ServerBundle\ValueObject\Scope;
use League\Bundle\OAuth2ServerBundle\Tests\Acceptance\AbstractAcceptanceTest;
use League\Bundle\OAuth2ServerBundle\Tests\Fixtures\FixtureFactory;
use League\Bundle\OAuth2ServerBundle\ValueObject\Scope;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/FixtureFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
use League\Bundle\OAuth2ServerBundle\Model\AccessToken;
use League\Bundle\OAuth2ServerBundle\Model\AuthorizationCode;
use League\Bundle\OAuth2ServerBundle\Model\Client;
use League\Bundle\OAuth2ServerBundle\Model\RefreshToken;
use League\Bundle\OAuth2ServerBundle\ValueObject\Grant;
use League\Bundle\OAuth2ServerBundle\ValueObject\RedirectUri;
use League\Bundle\OAuth2ServerBundle\Model\RefreshToken;
use League\Bundle\OAuth2ServerBundle\ValueObject\Scope;

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/ExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ private function getValidConfiguration(array $options = []): array
'foo',
],
],
//Pick one for valid config:
//'persistence' => ['doctrine' => []]
// Pick one for valid config:
// 'persistence' => ['doctrine' => []]
'persistence' => ['in_memory' => 1],
],
];
Expand Down

0 comments on commit a442c6c

Please sign in to comment.