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 8, 2021
1 parent 5ace89f commit f6ae59b
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 27 deletions.
12 changes: 4 additions & 8 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,10 @@ branches:
- "Webpack build"
- "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 @@ -141,8 +141,7 @@ jobs:
- highest

symfony:
- 4.4
- 5.1
- 5.4

steps:
- name: "Checkout"
Expand Down
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@
"psr/log": "^1.0",
"sonata-project/block-bundle": "^3.21 || ^4.5.1",
"sonata-project/form-extensions": "^1.1",
"symfony/config": "^4.2 || ^5.0",
"symfony/dependency-injection": "^4.2 || ^5.0",
"symfony/expression-language": "^4.2 || ^5.0",
"symfony/form": "^4.2 || ^5.0",
"symfony/framework-bundle": "^4.2 || ^5.0",
"symfony/http-foundation": "^4.2 || ^5.0",
"symfony/http-kernel": "^4.2 || ^5.0",
"symfony/options-resolver": "^4.2 || ^5.0",
"symfony/twig-bundle": "^4.2 || ^5.0",
"symfony/config": "^5.4",
"symfony/dependency-injection": "^5.4",
"symfony/expression-language": "^5.4",
"symfony/form": "^5.4",
"symfony/framework-bundle": "^5.4",
"symfony/http-foundation": "^5.4",
"symfony/http-kernel": "^5.4",
"symfony/options-resolver": "^5.4",
"symfony/twig-bundle": "^5.4",
"twig/extra-bundle": "^2.0 || ^3.0",
"twig/intl-extra": "^2.12 || ^3.0",
"twig/twig": "^2.4 || ^3.0"
Expand Down
24 changes: 22 additions & 2 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
parameters:
ignoreErrors:
-
message: "#^Instantiated class Symfony\\\\Component\\\\HttpKernel\\\\Client not found\\.$#"
message: "#^Dead catch \\- Exception is never thrown in the try block\\.$#"
count: 1
path: src/Connection/PsrClientConnection.php

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

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

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

-
message: "#^Call to method getResponse\\(\\) on an unknown class Symfony\\\\Component\\\\HttpKernel\\\\Client\\.$#"
count: 1
path: tests/Block/BlockServiceIntegrationTest.php

Expand All @@ -11,7 +31,7 @@ parameters:
path: tests/Block/BlockServiceIntegrationTest.php

-
message: "#^Call to method getResponse\\(\\) on an unknown class Symfony\\\\Component\\\\HttpKernel\\\\Client\\.$#"
message: "#^Instantiated class Symfony\\\\Component\\\\HttpKernel\\\\Client not found\\.$#"
count: 1
path: tests/Block/BlockServiceIntegrationTest.php

Expand Down
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_matomo');

Expand Down
25 changes: 20 additions & 5 deletions tests/App/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,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\Loader\Configurator\RoutingConfigurator;
use Symfony\Component\Routing\RouteCollectionBuilder;
use Twig\Extra\TwigExtraBundle\TwigExtraBundle;

Expand All @@ -32,7 +32,7 @@ public function __construct()
parent::__construct('test', false);
}

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

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

return;
}

$routes->add('/twig-test', TwigTestController::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

0 comments on commit f6ae59b

Please sign in to comment.