Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ jobs:
include:
- dependencies: 'beta'
symfony_version:
- 5.4
- 6.0
- 6.3
env:
SYMFONY_VERSION: '${{ matrix.symfony_version }}'
steps:
Expand Down
15 changes: 6 additions & 9 deletions Command/CleanCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@

use FOS\OAuthServerBundle\Model\AuthCodeManagerInterface;
use FOS\OAuthServerBundle\Model\TokenManagerInterface;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(
name: 'fos:oauth-server:clean',
description: 'Clean expired tokens',
)]
class CleanCommand extends Command
{
protected static $defaultName = 'fos:oauth-server:clean';

private $accessTokenManager;
private $refreshTokenManager;
private $authCodeManager;
Expand All @@ -39,10 +42,7 @@ public function __construct(
$this->authCodeManager = $authCodeManager;
}

/**
* {@inheritdoc}
*/
protected function configure()
protected function configure(): void
{
parent::configure();

Expand All @@ -57,9 +57,6 @@ protected function configure()
;
}

/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
foreach ([$this->accessTokenManager, $this->refreshTokenManager, $this->authCodeManager] as $service) {
Expand Down
15 changes: 6 additions & 9 deletions Command/CreateClientCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,19 @@
namespace FOS\OAuthServerBundle\Command;

use FOS\OAuthServerBundle\Model\ClientManagerInterface;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;

#[AsCommand(
name: 'fos:oauth-server:create-client',
description: 'Creates a new client',
)]
class CreateClientCommand extends Command
{
protected static $defaultName = 'fos:oauth-server:create-client';

private $clientManager;

public function __construct(ClientManagerInterface $clientManager)
Expand All @@ -33,10 +36,7 @@ public function __construct(ClientManagerInterface $clientManager)
$this->clientManager = $clientManager;
}

/**
* {@inheritdoc}
*/
protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down Expand Up @@ -66,9 +66,6 @@ protected function configure()
;
}

/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
class GrantExtensionsCompilerPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
$storageDefinition = $container->findDefinition('fos_oauth_server.storage');
$className = $container->getParameterBag()->resolveValue($storageDefinition->getClass());
Expand Down
5 changes: 1 addition & 4 deletions DependencyInjection/Compiler/RequestStackCompilerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
*/
final class RequestStackCompilerPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
if ($container->has('request_stack')) {
return;
Expand Down
3 changes: 0 additions & 3 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('fos_oauth_server');
Expand Down
8 changes: 1 addition & 7 deletions DependencyInjection/FOSOAuthServerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@

class FOSOAuthServerExtension extends Extension
{
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
public function load(array $configs, ContainerBuilder $container): void
{
$processor = new Processor();
$configuration = new Configuration();
Expand Down Expand Up @@ -101,9 +98,6 @@ public function load(array $configs, ContainerBuilder $container)
}
}

/**
* {@inheritdoc}
*/
public function getAlias(): string
{
return 'fos_oauth_server';
Expand Down
20 changes: 1 addition & 19 deletions DependencyInjection/Security/Factory/OAuthFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
*/
class OAuthFactory implements AuthenticatorFactoryInterface
{
/**
* {@inheritdoc}
*/
public function createAuthenticator(ContainerBuilder $container, string $id, array $config, string $userProviderId): array|string
{
$providerId = 'fos_oauth_server.security.authentication.authenticator.'.$id;
Expand All @@ -42,9 +39,6 @@ public function createAuthenticator(ContainerBuilder $container, string $id, arr
return $providerId;
}

/**
* {@inheritdoc}
*/
public function create(ContainerBuilder $container, $id, $config, $userProvider, $defaultEntryPoint): array
{
$providerId = 'security.authentication.provider.fos_oauth_server.'.$id;
Expand All @@ -60,34 +54,22 @@ public function create(ContainerBuilder $container, $id, $config, $userProvider,
return [$providerId, $listenerId, 'fos_oauth_server.security.entry_point'];
}

/**
* {@inheritdoc}
*/
public function getPosition(): string
{
return 'pre_auth';
}

/**
* {@inheritdoc}
*/
public function getPriority(): int
{
return 0;
}

/**
* {@inheritdoc}
*/
public function getKey(): string
{
return 'fos_oauth';
}

/**
* {@inheritdoc}
*/
public function addConfiguration(NodeDefinition $node)
public function addConfiguration(NodeDefinition $node): void
{
}
}
15 changes: 0 additions & 15 deletions Document/AuthCodeManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,43 +46,28 @@ public function __construct(DocumentManager $dm, $class)
$this->class = $class;
}

/**
* {@inheritdoc}
*/
public function getClass()
{
return $this->class;
}

/**
* {@inheritdoc}
*/
public function findAuthCodeBy(array $criteria)
{
return $this->repository->findOneBy($criteria);
}

/**
* {@inheritdoc}
*/
public function updateAuthCode(AuthCodeInterface $authCode)
{
$this->dm->persist($authCode);
$this->dm->flush();
}

/**
* {@inheritdoc}
*/
public function deleteAuthCode(AuthCodeInterface $authCode)
{
$this->dm->remove($authCode);
$this->dm->flush();
}

/**
* {@inheritdoc}
*/
public function deleteExpired()
{
$result = $this
Expand Down
12 changes: 0 additions & 12 deletions Document/ClientManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,34 +46,22 @@ public function __construct(DocumentManager $dm, $class)
$this->class = $class;
}

/**
* {@inheritdoc}
*/
public function getClass()
{
return $this->class;
}

/**
* {@inheritdoc}
*/
public function findClientBy(array $criteria)
{
return $this->repository->findOneBy($criteria);
}

/**
* {@inheritdoc}
*/
public function updateClient(ClientInterface $client)
{
$this->dm->persist($client);
$this->dm->flush();
}

/**
* {@inheritdoc}
*/
public function deleteClient(ClientInterface $client)
{
$this->dm->remove($client);
Expand Down
15 changes: 0 additions & 15 deletions Document/TokenManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,43 +46,28 @@ public function __construct(DocumentManager $dm, $class)
$this->class = $class;
}

/**
* {@inheritdoc}
*/
public function getClass()
{
return $this->class;
}

/**
* {@inheritdoc}
*/
public function findTokenBy(array $criteria)
{
return $this->repository->findOneBy($criteria);
}

/**
* {@inheritdoc}
*/
public function updateToken(TokenInterface $token)
{
$this->dm->persist($token);
$this->dm->flush();
}

/**
* {@inheritdoc}
*/
public function deleteToken(TokenInterface $token)
{
$this->dm->remove($token);
$this->dm->flush();
}

/**
* {@inheritdoc}
*/
public function deleteExpired()
{
$result = $this
Expand Down
15 changes: 0 additions & 15 deletions Entity/AuthCodeManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,43 +38,28 @@ public function __construct(EntityManagerInterface $em, $class)
$this->class = $class;
}

/**
* {@inheritdoc}
*/
public function getClass()
{
return $this->class;
}

/**
* {@inheritdoc}
*/
public function findAuthCodeBy(array $criteria)
{
return $this->em->getRepository($this->class)->findOneBy($criteria);
}

/**
* {@inheritdoc}
*/
public function updateAuthCode(AuthCodeInterface $authCode)
{
$this->em->persist($authCode);
$this->em->flush();
}

/**
* {@inheritdoc}
*/
public function deleteAuthCode(AuthCodeInterface $authCode)
{
$this->em->remove($authCode);
$this->em->flush();
}

/**
* {@inheritdoc}
*/
public function deleteExpired()
{
/** @var \Doctrine\ORM\EntityRepository $repository */
Expand Down
Loading