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 70c0c60 commit 469bd1c
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 41 deletions.
12 changes: 4 additions & 8 deletions .github/settings.yml
Expand Up @@ -17,14 +17,10 @@ branches:
- "Assets 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
Expand Up @@ -148,8 +148,7 @@ jobs:
- highest

symfony:
- 4.4
- 5.1
- 5.4

steps:
- name: "Checkout"
Expand Down
20 changes: 10 additions & 10 deletions composer.json
Expand Up @@ -48,15 +48,15 @@
"psr/log": "^1.0",
"sonata-project/block-bundle": "^3.23.0 || ^4.5.1",
"sonata-project/form-extensions": "^0.1 || ^1.4",
"symfony/config": "^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/options-resolver": "^4.4 || ^5.0",
"symfony/twig-bridge": "^4.4 || ^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-bridge": "^5.4",
"twig/twig": "^2.4 || ^3.0",
"willdurand/geocoder": "^4.2",
"willdurand/geocoder-bundle": "^5.11"
Expand All @@ -66,7 +66,7 @@
"geocoder-php/nominatim-provider": "^5.0",
"nyholm/psr7": "^1.0",
"php-http/mock-client": "^1.3",
"symfony/browser-kit": "^4.4 || ^5.0"
"symfony/browser-kit": "^5.4"
},
"suggest": {
"geocoder-php/bing-maps-provider": "For bing geocoder",
Expand Down
15 changes: 15 additions & 0 deletions phpstan-baseline.neon
Expand Up @@ -15,3 +15,18 @@ parameters:
count: 2
path: src/Twig/MapsExtensions.php

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

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

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

27 changes: 14 additions & 13 deletions psalm-baseline.xml
@@ -1,22 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.8.1@f73f2299dbc59a3e6c4d66cff4605176e728ee69">
<files psalm-version="v4.14.0@14dcbc908ab2625cd7a74258ee6c740cbecc6140">
<file src="src/Block/Service/MapBlockService.php">
<MixedAssignment occurrences="2">
<code>$latitude</code>
<code>$longitude</code>
</MixedAssignment>
<MixedReturnTypeCoercion occurrences="2">
<code>$geo-&gt;getCoordinates()-&gt;toArray()</code>
<code>array{float, float}|null</code>
</MixedReturnTypeCoercion>
<PossiblyNullArgument occurrences="1">
<code>$blockContext-&gt;getTemplate()</code>
</PossiblyNullArgument>
<PossiblyNullReference occurrences="1">
<code>toArray</code>
</PossiblyNullReference>
<UnusedClosureParam occurrences="2">
<code>$index</code>
<UnusedClosureParam occurrences="1">
<code>$value</code>
</UnusedClosureParam>
</file>
Expand Down Expand Up @@ -45,9 +37,18 @@
</MixedAssignment>
</file>
<file src="tests/App/AppKernel.php">
<DeprecatedClass occurrences="1">
<code>RouteCollectionBuilder</code>
</DeprecatedClass>
<MissingParamType occurrences="3">
<code>$container</code>
<code>$loader</code>
<code>$routes</code>
</MissingParamType>
<MixedMethodCall occurrences="2">
<code>add</code>
<code>load</code>
</MixedMethodCall>
<PropertyNotSetInConstructor occurrences="1">
<code>AppKernel</code>
</PropertyNotSetInConstructor>
</file>
<file src="tests/bootstrap.php">
<UnresolvableInclude occurrences="1">
Expand Down
26 changes: 20 additions & 6 deletions tests/App/AppKernel.php
Expand Up @@ -18,10 +18,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 @@ -39,7 +38,7 @@ public function __construct()
parent::__construct('test', false);
}

public function registerBundles()
public function registerBundles(): iterable
{
yield new FrameworkBundle();
yield new TwigBundle();
Expand All @@ -63,13 +62,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(BlockRenderController::class)
;

return;
}

$routes->add('/test', BlockRenderController::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');
}
}
3 changes: 1 addition & 2 deletions tests/App/config/config.yaml
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

cache:
app: cache.adapter.filesystem
Expand Down

0 comments on commit 469bd1c

Please sign in to comment.