Skip to content

Commit

Permalink
Drop symfony 4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Dec 7, 2021
1 parent 7d641d5 commit 21ebd13
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 55 deletions.
12 changes: 4 additions & 8 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@ branches:
contexts:
- "Coding Standards (8)"
- "Static Code Analysis (8.1)"
- "Test (PHP 8, symfony 4.4, lowest)"
- "Test (PHP 8, symfony 5.1, lowest)"
- "Test (PHP 8, symfony 4.4, highest)"
- "Test (PHP 8, symfony 5.1, highest)"
- "Test (PHP 8.1, symfony 4.4, lowest)"
- "Test (PHP 8.1, symfony 5.1, lowest)"
- "Test (PHP 8.1, symfony 4.4, highest)"
- "Test (PHP 8.1, symfony 5.1, highest)"
- "Test (PHP 8, symfony 5.4, lowest)"
- "Test (PHP 8, symfony 5.4, highest)"
- "Test (PHP 8.1, symfony 5.4, lowest)"
- "Test (PHP 8.1, symfony 5.4, highest)"
- "Code Coverage (8.1)"
- "Mutation Tests (8.1)"
strict: true
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ jobs:
- highest

symfony:
- 4.4
- 5.1
- 5.4

steps:
- name: "Checkout"
Expand Down
27 changes: 15 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,31 @@
],
"require": {
"php": "^8.0",
"nucleos/lastfm": "^3.0",
"nucleos/lastfm": "^3.2",
"psr/http-client": "^1.0",
"psr/http-message": "^1.0",
"symfony/config": "^4.4 || ^5.0",
"symfony/dependency-injection": "^4.4 || ^5.0",
"symfony/config": "^5.4",
"symfony/dependency-injection": "^5.4",
"symfony/event-dispatcher-contracts": "^1.1 || ^2.0",
"symfony/expression-language": "^4.4 || ^5.0"
"symfony/expression-language": "^5.4"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.3",
"ergebnis/composer-normalize": "^2.0.1",
"nyholm/psr7": "^1.0",
"symfony/browser-kit": "^4.4 || ^5.0",
"symfony/framework-bundle": "^4.4 || ^5.0",
"symfony/http-client": "^4.4 || ^5.0",
"symfony/http-foundation": "^4.4 || ^5.0",
"symfony/http-kernel": "^4.4 || ^5.0",
"symfony/routing": "^4.4 || ^5.0",
"symfony/twig-bridge": "^4.4 || ^5.0",
"symfony/twig-bundle": "^4.4 || ^5.0",
"symfony/browser-kit": "^5.4",
"symfony/framework-bundle": "^5.4",
"symfony/http-client": "^5.4",
"symfony/http-foundation": "^5.4",
"symfony/http-kernel": "^5.4",
"symfony/routing": "^5.4",
"symfony/twig-bridge": "^5.4",
"symfony/twig-bundle": "^5.4",
"twig/twig": "^2.4 || ^3.0"
},
"conflict": {
"symfony/translation-contracts": "<3.0"
},
"suggest": {
"symfony/http-client": "Symfony HTTP client implementation"
},
Expand Down
51 changes: 33 additions & 18 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,72 +1,87 @@
parameters:
ignoreErrors:
-
message: "#^Property Nucleos\\\\LastFmBundle\\\\Tests\\\\Action\\\\AuthErrorActionTest\\:\\:\\$twig has no typehint specified\\.$#"
message: "#^Method Nucleos\\\\LastFmBundle\\\\Action\\\\StartAuthAction\\:\\:generateUrl\\(\\) is unused\\.$#"
count: 1
path: tests/Action/AuthErrorActionTest.php
path: src/Action/StartAuthAction.php

-
message: "#^Property Nucleos\\\\LastFmBundle\\\\Tests\\\\Action\\\\AuthErrorActionTest\\:\\:\\$router has no typehint specified\\.$#"
message: "#^Property Nucleos\\\\LastFmBundle\\\\Tests\\\\Action\\\\AuthErrorActionTest\\:\\:\\$router has no type specified\\.$#"
count: 1
path: tests/Action/AuthErrorActionTest.php

-
message: "#^Property Nucleos\\\\LastFmBundle\\\\Tests\\\\Action\\\\AuthErrorActionTest\\:\\:\\$sessionManager has no typehint specified\\.$#"
message: "#^Property Nucleos\\\\LastFmBundle\\\\Tests\\\\Action\\\\AuthErrorActionTest\\:\\:\\$sessionManager has no type specified\\.$#"
count: 1
path: tests/Action/AuthErrorActionTest.php

-
message: "#^Property Nucleos\\\\LastFmBundle\\\\Tests\\\\Action\\\\AuthErrorActionTest\\:\\:\\$eventDispatcher has no typehint specified\\.$#"
message: "#^Property Nucleos\\\\LastFmBundle\\\\Tests\\\\Action\\\\AuthErrorActionTest\\:\\:\\$twig has no type specified\\.$#"
count: 1
path: tests/Action/AuthErrorActionTest.php

-
message: "#^Property Nucleos\\\\LastFmBundle\\\\Tests\\\\Action\\\\AuthSuccessActionTest\\:\\:\\$twig has no typehint specified\\.$#"
message: "#^Property Nucleos\\\\LastFmBundle\\\\Tests\\\\Action\\\\AuthSuccessActionTest\\:\\:\\$router has no type specified\\.$#"
count: 1
path: tests/Action/AuthSuccessActionTest.php

-
message: "#^Property Nucleos\\\\LastFmBundle\\\\Tests\\\\Action\\\\AuthSuccessActionTest\\:\\:\\$router has no typehint specified\\.$#"
message: "#^Property Nucleos\\\\LastFmBundle\\\\Tests\\\\Action\\\\AuthSuccessActionTest\\:\\:\\$sessionManager has no type specified\\.$#"
count: 1
path: tests/Action/AuthSuccessActionTest.php

-
message: "#^Property Nucleos\\\\LastFmBundle\\\\Tests\\\\Action\\\\AuthSuccessActionTest\\:\\:\\$sessionManager has no typehint specified\\.$#"
message: "#^Property Nucleos\\\\LastFmBundle\\\\Tests\\\\Action\\\\AuthSuccessActionTest\\:\\:\\$twig has no type specified\\.$#"
count: 1
path: tests/Action/AuthSuccessActionTest.php

-
message: "#^Property Nucleos\\\\LastFmBundle\\\\Tests\\\\Action\\\\AuthSuccessActionTest\\:\\:\\$eventDispatcher has no typehint specified\\.$#"
message: "#^Property Nucleos\\\\LastFmBundle\\\\Tests\\\\Action\\\\CheckAuthActionTest\\:\\:\\$authService has no type specified\\.$#"
count: 1
path: tests/Action/AuthSuccessActionTest.php
path: tests/Action/CheckAuthActionTest.php

-
message: "#^Property Nucleos\\\\LastFmBundle\\\\Tests\\\\Action\\\\CheckAuthActionTest\\:\\:\\$router has no typehint specified\\.$#"
message: "#^Property Nucleos\\\\LastFmBundle\\\\Tests\\\\Action\\\\CheckAuthActionTest\\:\\:\\$router has no type specified\\.$#"
count: 1
path: tests/Action/CheckAuthActionTest.php

-
message: "#^Property Nucleos\\\\LastFmBundle\\\\Tests\\\\Action\\\\CheckAuthActionTest\\:\\:\\$sessionManager has no typehint specified\\.$#"
message: "#^Property Nucleos\\\\LastFmBundle\\\\Tests\\\\Action\\\\CheckAuthActionTest\\:\\:\\$sessionManager has no type specified\\.$#"
count: 1
path: tests/Action/CheckAuthActionTest.php

-
message: "#^Property Nucleos\\\\LastFmBundle\\\\Tests\\\\Action\\\\CheckAuthActionTest\\:\\:\\$authService has no typehint specified\\.$#"
message: "#^Property Nucleos\\\\LastFmBundle\\\\Tests\\\\Action\\\\StartAuthActionTest\\:\\:\\$authService has no type specified\\.$#"
count: 1
path: tests/Action/CheckAuthActionTest.php
path: tests/Action/StartAuthActionTest.php

-
message: "#^Property Nucleos\\\\LastFmBundle\\\\Tests\\\\Action\\\\StartAuthActionTest\\:\\:\\$authService has no typehint specified\\.$#"
message: "#^Property Nucleos\\\\LastFmBundle\\\\Tests\\\\Action\\\\StartAuthActionTest\\:\\:\\$router has no type specified\\.$#"
count: 1
path: tests/Action/StartAuthActionTest.php

-
message: "#^Property Nucleos\\\\LastFmBundle\\\\Tests\\\\Action\\\\StartAuthActionTest\\:\\:\\$router has no typehint specified\\.$#"
message: "#^Method Nucleos\\\\LastFmBundle\\\\Tests\\\\App\\\\AppKernel\\:\\:configureContainer\\(\\) has parameter \\$container with no type specified\\.$#"
count: 1
path: tests/Action/StartAuthActionTest.php
path: tests/App/AppKernel.php

-
message: "#^Method Nucleos\\\\LastFmBundle\\\\Tests\\\\App\\\\AppKernel\\:\\:configureContainer\\(\\) has parameter \\$loader with no type specified\\.$#"
count: 1
path: tests/App/AppKernel.php

-
message: "#^Method Nucleos\\\\LastFmBundle\\\\Tests\\\\App\\\\AppKernel\\:\\:configureRoutes\\(\\) has parameter \\$routes with no type specified\\.$#"
count: 1
path: tests/App/AppKernel.php

-
message: "#^Method Nucleos\\\\LastFmBundle\\\\Tests\\\\EventDispatcher\\\\TestEventDispatcher\\:\\:dispatch\\(\\) has parameter \\$eventName with no type specified\\.$#"
count: 1
path: tests/EventDispatcher/TestEventDispatcher.php

-
message: "#^Property Nucleos\\\\LastFmBundle\\\\Tests\\\\EventDispatcher\\\\TestEventDispatcher\\:\\:\\$response has no typehint specified\\.$#"
message: "#^Method Nucleos\\\\LastFmBundle\\\\Tests\\\\EventDispatcher\\\\TestEventDispatcher\\:\\:dispatch\\(\\) should return TEvent of object but returns \\(Nucleos\\\\LastFmBundle\\\\Event\\\\AuthFailedEvent&TEvent of object\\)\\|\\(Nucleos\\\\LastFmBundle\\\\Event\\\\AuthSuccessEvent&TEvent of object\\)\\|TEvent of object\\.$#"
count: 1
path: tests/EventDispatcher/TestEventDispatcher.php

2 changes: 1 addition & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

final class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('nucleos_lastfm');

Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/NucleosLastFmExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

final class NucleosLastFmExtension extends Extension
{
public function getAlias()
public function getAlias(): string
{
return 'nucleos_lastfm';
}
Expand Down
3 changes: 2 additions & 1 deletion src/NucleosLastFmBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
namespace Nucleos\LastFmBundle;

use Nucleos\LastFmBundle\DependencyInjection\NucleosLastFmExtension;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;

final class NucleosLastFmBundle extends Bundle
{
public function getContainerExtension()
public function getContainerExtension(): ?ExtensionInterface
{
if (null === $this->extension) {
$this->extension = new NucleosLastFmExtension();
Expand Down
2 changes: 1 addition & 1 deletion tests/Action/AuthErrorActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class AuthErrorActionTest extends TestCase

private $sessionManager;

private $eventDispatcher;
private TestEventDispatcher $eventDispatcher;

protected function setUp(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Action/AuthSuccessActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ final class AuthSuccessActionTest extends TestCase

private $sessionManager;

private $eventDispatcher;
private TestEventDispatcher $eventDispatcher;

protected function setUp(): void
{
Expand Down
26 changes: 20 additions & 6 deletions tests/App/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Bundle\TwigBundle\TwigBundle;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Routing\RouteCollectionBuilder;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;

final class AppKernel extends Kernel
{
Expand All @@ -30,7 +29,7 @@ public function __construct()
parent::__construct('test', false);
}

public function registerBundles()
public function registerBundles(): iterable
{
yield new FrameworkBundle();
yield new TwigBundle();
Expand All @@ -52,13 +51,28 @@ public function getProjectDir(): string
return __DIR__;
}

protected function configureRoutes(RouteCollectionBuilder $routes): void
protected function configureRoutes($routes): void
{
if ($routes instanceof RoutingConfigurator) {
$routes
->add('test', '/test')
->controller(TestController::class)
;

return;
}

$routes->add('/test', TestController::class);
}

protected function configureContainer(ContainerBuilder $containerBuilder, LoaderInterface $loader): void
protected function configureContainer($container, $loader): void
{
if ($container instanceof ContainerConfigurator) {
$container->import(__DIR__.'/config/config.yaml');

return;
}

$loader->load(__DIR__.'/config/config.yaml');
}

Expand Down
3 changes: 1 addition & 2 deletions tests/App/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ framework:
secret: secret

session:
storage_id: 'session.storage.mock_file'
handler_id: 'session.handler.native_file'
storage_factory_id: session.storage.factory.mock_file

nucleos_lastfm:
api:
Expand Down
4 changes: 2 additions & 2 deletions tests/EventDispatcher/TestEventDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

final class TestEventDispatcher implements EventDispatcherInterface
{
private $response;
private ?Response $response = null;

public function dispatch($event, $eventName = null): object
{
Expand All @@ -29,7 +29,7 @@ public function dispatch($event, $eventName = null): object
return $event;
}

public function setResponse(Response $response): void
public function setResponse(?Response $response): void
{
$this->response = $response;
}
Expand Down

0 comments on commit 21ebd13

Please sign in to comment.