Skip to content

Commit

Permalink
Symfony 7 + php 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
a-menshchikov committed Jan 8, 2024
1 parent 6ca7950 commit 7b0fc69
Show file tree
Hide file tree
Showing 47 changed files with 190 additions and 176 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
name: Audit
strategy:
matrix:
php-version: [ '8.1', '8.2', '8.3' ]
php-version: [ '8.2', '8.3' ]
fail-fast: false
runs-on: ubuntu-latest
steps:
Expand Down
45 changes: 18 additions & 27 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
],
"require": {
"php": "^8.1",
"php": "^8.2",
"ext-filter": "*",
"ext-hash": "*",
"ext-json": "*",
Expand All @@ -24,25 +24,25 @@
"psr/cache": "^3",
"psr/log": "^3",
"snc/redis-bundle": "^4.5",
"symfony/cache": "^6.4",
"symfony/cache": "^7",
"symfony/cache-contracts": "^3",
"symfony/config": "^6.4",
"symfony/console": "^6.4",
"symfony/dependency-injection": "^6.4",
"symfony/error-handler": "^6.4",
"symfony/event-dispatcher": "^6.4",
"symfony/config": "^7",
"symfony/console": "^7",
"symfony/dependency-injection": "^7",
"symfony/error-handler": "^7",
"symfony/event-dispatcher": "^7",
"symfony/event-dispatcher-contracts": "^3",
"symfony/expression-language": "^6.4",
"symfony/framework-bundle": "^6.4",
"symfony/http-client": "^6.4",
"symfony/expression-language": "^7",
"symfony/framework-bundle": "^7",
"symfony/http-client": "^7",
"symfony/http-client-contracts": "^3",
"symfony/http-foundation": "^6.4",
"symfony/http-kernel": "^6.4",
"symfony/routing": "^6.4",
"symfony/security-bundle": "^6.4",
"symfony/security-core": "^6.4",
"symfony/security-http": "^6.4",
"symfony/uid": "^6.4",
"symfony/http-foundation": "^7",
"symfony/http-kernel": "^7",
"symfony/routing": "^7",
"symfony/security-bundle": "^7",
"symfony/security-core": "^7",
"symfony/security-http": "^7",
"symfony/uid": "^7",
"web-token/jwt-framework": "^3.2"
},
"require-dev": {
Expand All @@ -51,16 +51,7 @@
"psr/event-dispatcher": "^1",
"psr/event-dispatcher-implementation": "1.0",
"roave/security-advisories": "dev-latest",
"symfony/clock": "^6.4",
"symfony/filesystem": "^6.4",
"symfony/finder": "^6.4",
"symfony/password-hasher": "^6.4",
"symfony/phpunit-bridge": "^6.4",
"symfony/property-access": "^6.4",
"symfony/property-info": "^6.4",
"symfony/security-csrf": "^6.4",
"symfony/string": "^6.4",
"symfony/var-exporter": "^6.4"
"symfony/phpunit-bridge": "^7"
},
"repositories": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class Configuration implements ConfigurationInterface
{
/**
* @suppress PhanPossiblyNonClassMethodCall, PhanPossiblyUndeclaredMethod
* @suppress PhanPossiblyUndeclaredMethod
*/
public function getConfigTreeBuilder(): TreeBuilder
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

use SingleA\Contracts\PayloadFetcher\FetcherConfigFactoryInterface;

final class JsonFetcherConfigFactory implements FetcherConfigFactoryInterface
final readonly class JsonFetcherConfigFactory implements FetcherConfigFactoryInterface
{
public function __construct(
private readonly bool $httpsOnly,
private bool $httpsOnly,
) {}

public function getConfigClass(): string
Expand Down
4 changes: 2 additions & 2 deletions src/Bundles/JsonFetcher/JsonFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
use SingleA\Contracts\PayloadFetcher\FetcherInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;

final class JsonFetcher implements FetcherInterface
final readonly class JsonFetcher implements FetcherInterface
{
public function __construct(
private readonly HttpClientInterface $httpClient,
private HttpClientInterface $httpClient,
) {}

public function supports(FetcherConfigInterface|string $config): bool
Expand Down
2 changes: 2 additions & 0 deletions src/Bundles/JsonFetcher/SingleaJsonFetcherBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@

/**
* @final
*
* @psalm-suppress MissingConstructor
*/
class SingleaJsonFetcherBundle extends Bundle {}
8 changes: 4 additions & 4 deletions src/Bundles/JsonFetcher/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
}
],
"require": {
"php": "^8.1",
"php": "^8.2",
"nbgrp/singlea-payload-fetcher-contracts": "^1",
"symfony/config": "^6.4",
"symfony/dependency-injection": "^6.4",
"symfony/config": "^7",
"symfony/dependency-injection": "^7",
"symfony/http-client-contracts": "^3",
"symfony/http-client-implementation": "^3",
"symfony/http-kernel": "^6.4"
"symfony/http-kernel": "^7"
},
"provide": {
"nbgrp/singlea-payload-fetcher-implementation": "1.0"
Expand Down
2 changes: 1 addition & 1 deletion src/Bundles/Jwt/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class Configuration implements ConfigurationInterface
{
/**
* @suppress PhanPossiblyNonClassMethodCall, PhanPossiblyUndeclaredMethod
* @suppress PhanPossiblyUndeclaredMethod
*/
public function getConfigTreeBuilder(): TreeBuilder
{
Expand Down
8 changes: 4 additions & 4 deletions src/Bundles/Jwt/JwtTokenizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
use SingleA\Contracts\Tokenization\TokenizerConfigInterface;
use SingleA\Contracts\Tokenization\TokenizerInterface;

final class JwtTokenizer implements TokenizerInterface
final readonly class JwtTokenizer implements TokenizerInterface
{
private Signature\Serializer\CompactSerializer $jwsSerializer;

public function __construct(
private readonly string $issuer,
private readonly JWSBuilderFactory $jwsBuilderFactory,
private readonly NestedTokenBuilderFactory $nestedTokenBuilderFactory,
private string $issuer,
private JWSBuilderFactory $jwsBuilderFactory,
private NestedTokenBuilderFactory $nestedTokenBuilderFactory,
) {
$this->jwsSerializer = new Signature\Serializer\CompactSerializer();
}
Expand Down
2 changes: 2 additions & 0 deletions src/Bundles/Jwt/SingleaJwtBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@

/**
* @final
*
* @psalm-suppress MissingConstructor
*/
class SingleaJwtBundle extends Bundle {}
14 changes: 8 additions & 6 deletions src/Bundles/Jwt/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@
}
],
"require": {
"php": "^8.1",
"php": "^8.2",
"ext-json": "*",
"nbgrp/singlea-tokenization-contracts": "^1",
"symfony/config": "^6.4",
"symfony/dependency-injection": "^6.4",
"symfony/error-handler": "^6.4",
"symfony/http-kernel": "^6.4",
"web-token/jwt-framework": "^3.0.7"
"symfony/config": "^7",
"symfony/dependency-injection": "^7",
"symfony/error-handler": "^7",
"symfony/http-kernel": "^7",
"web-token/jwt-framework": "^3.2"
},
"require-dev": {
"ext-redis": "*",
"predis/predis": "^2",
"psr/event-dispatcher": "^1",
"psr/event-dispatcher-implementation": "1.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class Configuration implements ConfigurationInterface
{
/**
* @suppress PhanPossiblyNonClassMethodCall, PhanPossiblyUndeclaredMethod
* @suppress PhanPossiblyUndeclaredMethod
*/
public function getConfigTreeBuilder(): TreeBuilder
{
Expand Down
12 changes: 6 additions & 6 deletions src/Bundles/JwtFetcher/JwtFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
use SingleA\Contracts\PayloadFetcher\FetcherInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;

final class JwtFetcher implements FetcherInterface
final readonly class JwtFetcher implements FetcherInterface
{
private Signature\Serializer\CompactSerializer $jwsSerializer;

public function __construct(
private readonly HttpClientInterface $httpClient,
private readonly JWSBuilderFactory $jwsBuilderFactory,
private readonly NestedTokenBuilderFactory $nestedTokenBuilderFactory,
private readonly JWSLoaderFactory $jwsLoaderFactory,
private readonly NestedTokenLoaderFactory $nestedTokenLoaderFactory,
private HttpClientInterface $httpClient,
private JWSBuilderFactory $jwsBuilderFactory,
private NestedTokenBuilderFactory $nestedTokenBuilderFactory,
private JWSLoaderFactory $jwsLoaderFactory,
private NestedTokenLoaderFactory $nestedTokenLoaderFactory,
) {
$this->jwsSerializer = new Signature\Serializer\CompactSerializer();
}
Expand Down
2 changes: 2 additions & 0 deletions src/Bundles/JwtFetcher/SingleaJwtFetcherBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@

/**
* @final
*
* @psalm-suppress MissingConstructor
*/
class SingleaJwtFetcherBundle extends Bundle {}
12 changes: 7 additions & 5 deletions src/Bundles/JwtFetcher/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@
}
],
"require": {
"php": "^8.1",
"php": "^8.2",
"ext-json": "*",
"nbgrp/singlea-payload-fetcher-contracts": "^1",
"symfony/config": "^6.4",
"symfony/dependency-injection": "^6.4",
"symfony/config": "^7",
"symfony/dependency-injection": "^7",
"symfony/http-client-contracts": "^3",
"symfony/http-client-implementation": "^3",
"symfony/http-kernel": "^6.4",
"web-token/jwt-framework": "^3.0.7"
"symfony/http-kernel": "^7",
"web-token/jwt-framework": "^3.2"
},
"require-dev": {
"ext-redis": "*",
"predis/predis": "^2",
"psr/event-dispatcher": "^1",
"psr/event-dispatcher-implementation": "1.0"
},
Expand Down
8 changes: 4 additions & 4 deletions src/Bundles/Redis/ClientManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
use Psr\Log\LoggerInterface;
use SingleA\Contracts\Persistence\ClientManagerInterface;

final class ClientManager implements ClientManagerInterface
final readonly class ClientManager implements ClientManagerInterface
{
public function __construct(
private readonly string $key,
private readonly \Predis\ClientInterface|\Redis|\RedisCluster|\Relay\Relay $redis,
private readonly ?LoggerInterface $logger = null,
private string $key,
private \Predis\ClientInterface|\Redis|\RedisCluster|\Relay\Relay $redis,
private ?LoggerInterface $logger = null,
) {}

public function exists(string $id, bool $touch = true): bool
Expand Down
2 changes: 1 addition & 1 deletion src/Bundles/Redis/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class Configuration implements ConfigurationInterface
{
/**
* @suppress PhanPossiblyNonClassMethodCall, PhanPossiblyUndeclaredMethod
* @suppress PhanPossiblyUndeclaredMethod
*/
public function getConfigTreeBuilder(): TreeBuilder
{
Expand Down
2 changes: 2 additions & 0 deletions src/Bundles/Redis/SingleaRedisBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

/**
* @final
*
* @psalm-suppress MissingConstructor
*/
class SingleaRedisBundle extends Bundle
{
Expand Down
15 changes: 8 additions & 7 deletions src/Bundles/Redis/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@
}
],
"require": {
"php": "^8.1",
"php": "^8.2",
"nbgrp/singlea-feature-config-contracts": "^1",
"nbgrp/singlea-marshaller-contracts": "^1",
"nbgrp/singlea-persistence-contracts": "^1",
"psr/log": "^3",
"snc/redis-bundle": "^3.6 || ^4",
"symfony/dependency-injection": "^6.4",
"symfony/http-foundation": "^6.4",
"symfony/http-kernel": "^6.4"
"snc/redis-bundle": "^4",
"symfony/dependency-injection": "^7",
"symfony/http-foundation": "^7",
"symfony/http-kernel": "^7"
},
"require-dev": {
"predis/predis": "^1",
"symfony/cache": "^6.4"
"ext-redis": "*",
"predis/predis": "^2",
"symfony/cache": "^7"
},
"provide": {
"nbgrp/singlea-persistence-implementation": "1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
*
* @see ClientListener
*/
final class FeatureConfigResolver implements ValueResolverInterface
final readonly class FeatureConfigResolver implements ValueResolverInterface
{
public function __construct(
private readonly ConfigRetrieverInterface $configRetriever,
private ConfigRetrieverInterface $configRetriever,
) {}

public function resolve(Request $request, ArgumentMetadata $argument): array
Expand Down
4 changes: 2 additions & 2 deletions src/Bundles/Singlea/Controller/Feature/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException;

#[AsController]
final class Token
final readonly class Token
{
/**
* @param iterable<TokenizerInterface> $tokenizers
*/
public function __construct(
private readonly iterable $tokenizers,
private iterable $tokenizers,
) {}

public function __invoke(
Expand Down
2 changes: 1 addition & 1 deletion src/Bundles/Singlea/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
class Configuration implements ConfigurationInterface
{
/**
* @suppress PhanPossiblyNonClassMethodCall, PhanPossiblyUndeclaredMethod
* @suppress PhanPossiblyUndeclaredMethod
*/
public function getConfigTreeBuilder(): TreeBuilder
{
Expand Down
10 changes: 5 additions & 5 deletions src/Bundles/Singlea/EventListener/ClientListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\Uid\UuidV6;

final class ClientListener
final readonly class ClientListener
{
public const CLIENT_ID_ATTRIBUTE = '__client_id';
public const SECRET_ATTRIBUTE = '__secret';

public function __construct(
private readonly string $clientIdQueryParameterName,
private readonly string $secretQueryParameterName,
private readonly ClientManagerInterface $clientManager,
private readonly ?LoggerInterface $logger = null,
private string $clientIdQueryParameterName,
private string $secretQueryParameterName,
private ClientManagerInterface $clientManager,
private ?LoggerInterface $logger = null,
) {}

#[AsEventListener(KernelEvents::REQUEST, priority: 31)]
Expand Down
Loading

0 comments on commit 7b0fc69

Please sign in to comment.