Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop symfony 4 support #401

Merged
merged 1 commit into from
Dec 6, 2021
Merged
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
16 changes: 6 additions & 10 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,14 @@ branches:
enforce_admins: false
required_status_checks:
contexts:
- "Coding Standards (8)"
- "Coding Standards (8.1)"
- "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)"
- "Mutation Tests (8)"
strict: true

required_pull_request_reviews: null
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
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@
"require": {
"php": "^8.0",
"dompdf/dompdf": "^0.7 || ^0.8 || ^1.0.0",
"symfony/config": "^4.2 || ^5.0",
"symfony/dependency-injection": "^4.2 || ^5.0",
"symfony/config": "^5.4",
"symfony/dependency-injection": "^5.4",
"symfony/event-dispatcher-contracts": "^1.1 || ^2.0",
"symfony/expression-language": "^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/expression-language": "^5.4",
"symfony/framework-bundle": "^5.4",
"symfony/http-foundation": "^5.4",
"symfony/http-kernel": "^5.4"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.3",
"ergebnis/composer-normalize": "^2.0.1",
"symfony/browser-kit": "^4.4 || ^5.0"
"symfony/browser-kit": "^5.4"
},
"suggest": {
"symfony/event-dispatcher": "If you need to modify the PDF rendering"
Expand Down
19 changes: 17 additions & 2 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
parameters:
ignoreErrors:
-
message: "#^Instantiated class Symfony\\\\Component\\\\HttpKernel\\\\Client not found\\.$#"
message: "#^Method Nucleos\\\\DompdfBundle\\\\Tests\\\\App\\\\AppKernel\\:\\:configureContainer\\(\\) has parameter \\$container with no type specified\\.$#"
count: 1
path: tests/App/AppKernel.php

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

-
message: "#^Method Nucleos\\\\DompdfBundle\\\\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/BundleIntegrationTest.php

Expand All @@ -11,7 +26,7 @@ parameters:
path: tests/BundleIntegrationTest.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/BundleIntegrationTest.php

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

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

Expand Down
26 changes: 20 additions & 6 deletions tests/App/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
use Nucleos\DompdfBundle\Tests\App\Controller\SampleTestController;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
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 @@ -29,7 +28,7 @@ public function __construct()
parent::__construct('test', false);
}

public function registerBundles()
public function registerBundles(): iterable
{
yield new FrameworkBundle();
yield new NucleosDompdfBundle();
Expand All @@ -50,13 +49,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(SampleTestController::class)
;

return;
}

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