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 83b2d63 commit 7c62a26
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 39 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
26 changes: 13 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,26 +45,26 @@
"sonata-project/block-bundle": "^3.23.0 || ^4.5.1",
"sonata-project/doctrine-extensions": "^1.1",
"sonata-project/form-extensions": "^0.1.1 || ^1.4",
"symfony/config": "^4.4 || ^5.0",
"symfony/console": "^4.4 || ^5.0",
"symfony/dependency-injection": "^4.4 || ^5.0",
"symfony/expression-language": "^4.4 || ^5.0",
"symfony/form": "^4.4 || ^5.0",
"symfony/framework-bundle": "^4.4 || ^5.0",
"symfony/http-foundation": "^4.4 || ^5.0",
"symfony/http-kernel": "^4.4 || ^5.0",
"symfony/mailer": "^4.4 || ^5.0",
"symfony/mime": "^4.4 || ^5.0",
"symfony/options-resolver": "^4.4 || ^5.0",
"symfony/config": "^5.4",
"symfony/console": "^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/mailer": "^5.4",
"symfony/mime": "^5.4",
"symfony/options-resolver": "^5.4",
"symfony/translation-contracts": "^1.1 || ^2.0",
"symfony/twig-bridge": "^4.4 || ^5.0",
"symfony/twig-bridge": "^5.4",
"twig/intl-extra": "^2.4 || ^3.0",
"twig/twig": "^2.4 || ^3.0"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.2",
"ergebnis/composer-normalize": "^2.0.1",
"symfony/browser-kit": "^4.4 || ^5.0"
"symfony/browser-kit": "^5.4"
},
"autoload": {
"psr-4": {
Expand Down
15 changes: 15 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,18 @@ parameters:
count: 1
path: src/Service/StatisticServiceInterface.php

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

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

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

12 changes: 6 additions & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" bootstrap="tests/bootstrap.php">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" bootstrap="tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">./src/</directory>
</include>
</coverage>
<php>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0"/>
</php>
Expand All @@ -11,9 +16,4 @@
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
</listeners>
<filter>
<whitelist>
<directory suffix=".php">./src/</directory>
</whitelist>
</filter>
</phpunit>
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_allinkl');

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

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

use Nucleos\AllInklBundle\DependencyInjection\NucleosAllInklExtension;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;

final class NucleosAllInklBundle extends Bundle
{
public function getContainerExtension()
public function getContainerExtension(): ?ExtensionInterface
{
if (null === $this->extension) {
$this->extension = new NucleosAllInklExtension();
Expand Down
2 changes: 1 addition & 1 deletion src/Service/AbstractService.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ abstract class AbstractService implements LoggerAwareInterface
public function __construct(string $endpoint = null)
{
if (null === $endpoint) {
$endpoint = static::DEFAULT_API_ENDPOINT;
$endpoint = self::DEFAULT_API_ENDPOINT;
}

$this->endpoint = $endpoint;
Expand Down
26 changes: 20 additions & 6 deletions tests/App/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +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\RouteCollectionBuilder;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;

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

public function registerBundles()
public function registerBundles(): iterable
{
yield new FrameworkBundle();
yield new TwigBundle();
Expand All @@ -61,13 +60,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');
}
}

0 comments on commit 7c62a26

Please sign in to comment.