Skip to content

Commit 63c91dd

Browse files
authored
Remove Symfony 5 support (#128)
1 parent a7338a8 commit 63c91dd

31 files changed

Lines changed: 53 additions & 217 deletions

.github/workflows/tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
php: [ '8.1', '8.2', '8.3', '8.4', '8.5' ]
22-
symfony: [ '5.4', '6.4', '7.4', '8.0' ]
22+
symfony: [ '6.4', '7.4', '8.0' ]
2323
dependencies: [ 'highest', 'lowest' ]
2424
exclude:
2525
- php: '8.1'

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.0.0] - xxxx-xx-xx
9+
10+
### Removed
11+
12+
- Symfony v5 support by @HypeMC in https://github.com/sofascore/purgatory-bundle/pull/128
13+
814
## [1.3.0] - 2025-12-15
915

1016
### Added
@@ -48,6 +54,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4854

4955
- Initial release
5056

57+
[2.0.0]: https://github.com/sofascore/purgatory-bundle/compare/v1.3.0...v2.0.0
5158
[1.3.0]: https://github.com/sofascore/purgatory-bundle/compare/v1.2.1...v1.3.0
5259
[1.2.1]: https://github.com/sofascore/purgatory-bundle/compare/v1.2.0...v1.2.1
5360
[1.2.0]: https://github.com/sofascore/purgatory-bundle/compare/v1.1.1...v1.2.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ entities and generates URLs that need purging based on configured routes.
3131
## Requirements
3232

3333
- [PHP 8.1](http://php.net/releases/8_1_0.php) or higher
34-
- [Symfony 5.4](https://symfony.com/roadmap/5.4) or [Symfony 6.4](https://symfony.com/roadmap/6.4) or higher
34+
- [Symfony 6.4](https://symfony.com/roadmap/6.4) or [Symfony 7.4](https://symfony.com/roadmap/7.4) or higher
3535

3636
## Installation
3737

composer.json

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -34,37 +34,37 @@
3434
"doctrine/dbal": "^3.8 || ^4.0",
3535
"doctrine/doctrine-bundle": "^2.12 || ^3.0",
3636
"doctrine/orm": "^2.19 || ^3.1",
37-
"symfony/config": "^5.4 || ^6.4 || ^7.4 || ^8.0",
38-
"symfony/console": "^5.4 || ^6.4 || ^7.4 || ^8.0",
39-
"symfony/dependency-injection": "^5.4 || ^6.4 || ^7.4 || ^8.0",
40-
"symfony/finder": "^5.4 || ^6.4 || ^7.4 || ^8.0",
41-
"symfony/framework-bundle": "^5.4 || ^6.4 || ^7.4 || ^8.0",
42-
"symfony/http-kernel": "^5.4 || ^6.4 || ^7.4 || ^8.0",
37+
"symfony/config": "^6.4 || ^7.4 || ^8.0",
38+
"symfony/console": "^6.4 || ^7.4 || ^8.0",
39+
"symfony/dependency-injection": "^6.4 || ^7.4 || ^8.0",
40+
"symfony/finder": "^6.4 || ^7.4 || ^8.0",
41+
"symfony/framework-bundle": "^6.4 || ^7.4 || ^8.0",
42+
"symfony/http-kernel": "^6.4 || ^7.4 || ^8.0",
4343
"symfony/polyfill-php84": "^1.30",
44-
"symfony/property-access": "^5.4 || ^6.4 || ^7.4 || ^8.0",
45-
"symfony/property-info": "^5.4 || ^6.4 || ^7.4 || ^8.0",
46-
"symfony/routing": "^5.4 || ^6.4 || ^7.4 || ^8.0"
44+
"symfony/property-access": "^6.4 || ^7.4 || ^8.0",
45+
"symfony/property-info": "^6.4 || ^7.4 || ^8.0",
46+
"symfony/routing": "^6.4 || ^7.4 || ^8.0"
4747
},
4848
"require-dev": {
4949
"doctrine/common": "^3.2",
5050
"phpunit/phpunit": "^12.5",
51-
"symfony/cache": "^5.4 || ^6.4 || ^7.4 || ^8.0",
52-
"symfony/doctrine-messenger": "^5.4 || ^6.4 || ^7.4 || ^8.0",
53-
"symfony/expression-language": "^5.4 || ^6.4 || ^7.4 || ^8.0",
54-
"symfony/filesystem": "^5.4 || ^6.4 || ^7.4 || ^8.0",
55-
"symfony/http-client": "^5.4 || ^6.4 || ^7.4 || ^8.0",
56-
"symfony/messenger": "^5.4 || ^6.4 || ^7.4 || ^8.0",
57-
"symfony/process": "^5.4 || ^6.4 || ^7.4 || ^8.0",
58-
"symfony/serializer": "^5.4 || ^6.4 || ^7.4 || ^8.0",
59-
"symfony/yaml": "^5.4 || ^6.4 || ^7.4 || ^8.0"
51+
"symfony/cache": "^6.4 || ^7.4 || ^8.0",
52+
"symfony/doctrine-messenger": "^6.4 || ^7.4 || ^8.0",
53+
"symfony/expression-language": "^6.4 || ^7.4 || ^8.0",
54+
"symfony/filesystem": "^6.4 || ^7.4 || ^8.0",
55+
"symfony/http-client": "^6.4 || ^7.4 || ^8.0",
56+
"symfony/messenger": "^6.4 || ^7.4 || ^8.0",
57+
"symfony/process": "^6.4 || ^7.4 || ^8.0",
58+
"symfony/serializer": "^6.4 || ^7.4 || ^8.0",
59+
"symfony/yaml": "^6.4 || ^7.4 || ^8.0"
6060
},
6161
"conflict": {
62-
"symfony/cache": "<5.4",
63-
"symfony/expression-language": "<5.4",
64-
"symfony/http-client": "<5.4",
65-
"symfony/messenger": "<5.4",
66-
"symfony/serializer": "<5.4",
67-
"symfony/yaml": "<5.4"
62+
"symfony/cache": "<6.4",
63+
"symfony/expression-language": "<6.4",
64+
"symfony/http-client": "<6.4",
65+
"symfony/messenger": "<6.4",
66+
"symfony/serializer": "<6.4",
67+
"symfony/yaml": "<6.4"
6868
},
6969
"scripts": {
7070
"run-checks": [

phpstan-baseline.neon

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,11 @@
11
parameters:
22
ignoreErrors:
3-
-
4-
message: '#^Comparison operation "\>" between 8 and 5 is always true\.$#'
5-
identifier: greater.alwaysTrue
6-
count: 1
7-
path: src/Attribute/RouteParamValue/DynamicValues.php
8-
93
-
104
message: '#^Call to function is_a\(\) with arguments class\-string\<BackedEnum\>, ''BackedEnum'' and true will always evaluate to true\.$#'
115
identifier: function.alreadyNarrowedType
126
count: 1
137
path: src/Attribute/RouteParamValue/EnumValues.php
148

15-
-
16-
message: '#^Comparison operation "\>" between 8 and 5 is always true\.$#'
17-
identifier: greater.alwaysTrue
18-
count: 1
19-
path: src/Attribute/RouteParamValue/PropertyValues.php
20-
219
-
2210
message: '#^Parameter \#1 \$configuration of class Sofascore\\PurgatoryBundle\\Cache\\Configuration\\Configuration constructor expects array\<non\-empty\-string, list\<array\{routeName\: string, routeParams\?\: array\<string, array\{type\: string, values\: list\<mixed\>, optional\?\: true\}\>, if\?\: string, actions\?\: non\-empty\-list\<Sofascore\\PurgatoryBundle\\Listener\\Enum\\Action\>\}\>\>, mixed given\.$#'
2311
identifier: argument.type
@@ -72,54 +60,12 @@ parameters:
7260
count: 1
7361
path: src/Cache/RouteMetadata/YamlMetadataProvider.php
7462

75-
-
76-
message: '#^Comparison operation "\>\=" between 0 and 1 is always false\.$#'
77-
identifier: greaterOrEqual.alwaysFalse
78-
count: 1
79-
path: src/Command/DebugCommand.php
80-
81-
-
82-
message: '#^Comparison operation "\>\=" between 8 and 7 is always true\.$#'
83-
identifier: greaterOrEqual.alwaysTrue
84-
count: 1
85-
path: src/Command/DebugCommand.php
86-
87-
-
88-
message: '#^Result of && is always false\.$#'
89-
identifier: booleanAnd.alwaysFalse
90-
count: 1
91-
path: src/Command/DebugCommand.php
92-
93-
-
94-
message: '#^Result of \|\| is always true\.$#'
95-
identifier: booleanOr.alwaysTrue
96-
count: 1
97-
path: src/Command/DebugCommand.php
98-
99-
-
100-
message: '#^Strict comparison using \=\=\= between \*NEVER\* and 6 will always evaluate to false\.$#'
101-
identifier: identical.alwaysFalse
102-
count: 1
103-
path: src/Command/DebugCommand.php
104-
10563
-
10664
message: '#^Strict comparison using \=\=\= between 8 and 6 will always evaluate to false\.$#'
10765
identifier: identical.alwaysFalse
10866
count: 1
10967
path: src/Command/DebugCommand.php
11068

111-
-
112-
message: '#^Comparison operation "\<\=" between 8 and 5 is always false\.$#'
113-
identifier: smallerOrEqual.alwaysFalse
114-
count: 1
115-
path: src/DependencyInjection/CompilerPass/RegisterExpressionLanguageProvidersPass.php
116-
117-
-
118-
message: '#^Comparison operation "\<\=" between 8 and 5 is always false\.$#'
119-
identifier: smallerOrEqual.alwaysFalse
120-
count: 1
121-
path: src/DependencyInjection/CompilerPass/RegisterRouteParamServicesPass.php
122-
12369
-
12470
message: '#^Parameter \#2 \$configurator of method Symfony\\Component\\DependencyInjection\\ContainerBuilder\:\:registerAttributeForAutoconfiguration\(\) expects callable\(Symfony\\Component\\DependencyInjection\\ChildDefinition, Sofascore\\PurgatoryBundle\\Attribute\\AsExpressionLanguageFunction, Reflector\)\: void, Closure\(Symfony\\Component\\DependencyInjection\\ChildDefinition, Sofascore\\PurgatoryBundle\\Attribute\\AsExpressionLanguageFunction, ReflectionClass\|ReflectionMethod\)\: void given\.$#'
12571
identifier: argument.type

psalm-baseline.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="6.3.0@222dda8483516044c2ed7a4c3f197d7c9d6c3ddb">
2+
<files psalm-version="6.14.2@bbd217fc98c0daa0a13aea2a7f119d03ba3fc9a0">
33
<file src="src/Cache/Configuration/CachedConfigurationLoader.php">
44
<MixedArgument>
55
<code><![CDATA[require $cache->getPath()]]></code>
@@ -41,7 +41,6 @@
4141
</InvalidArgument>
4242
<TypeDoesNotContainType>
4343
<code><![CDATA[Kernel::MAJOR_VERSION === 6]]></code>
44-
<code><![CDATA[Kernel::MAJOR_VERSION === 6]]></code>
4544
</TypeDoesNotContainType>
4645
</file>
4746
<file src="src/DependencyInjection/PurgatoryExtension.php">

src/Attribute/RouteParamValue/DynamicValues.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
namespace Sofascore\PurgatoryBundle\Attribute\RouteParamValue;
66

7-
use Symfony\Component\HttpKernel\Kernel;
8-
97
final class DynamicValues extends AbstractValues implements InverseValuesAwareInterface
108
{
119
/**
@@ -29,7 +27,7 @@ public function buildInverseValuesFor(string $association): ValuesInterface
2927
{
3028
return new self(
3129
alias: $this->alias,
32-
arg: null !== $this->arg ? \sprintf('%s%s.%s', $association, Kernel::MAJOR_VERSION > 5 ? '?' : '', $this->arg) : $association,
30+
arg: null !== $this->arg ? \sprintf('%s?.%s', $association, $this->arg) : $association,
3331
);
3432
}
3533

src/Attribute/RouteParamValue/PropertyValues.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
namespace Sofascore\PurgatoryBundle\Attribute\RouteParamValue;
66

7-
use Symfony\Component\HttpKernel\Kernel;
8-
97
final class PropertyValues extends AbstractValues implements InverseValuesAwareInterface
108
{
119
/** @var non-empty-list<string> */
@@ -30,7 +28,7 @@ public function buildInverseValuesFor(string $association): ValuesInterface
3028
{
3129
return new self(
3230
...array_map(
33-
static fn (string $property): string => \sprintf('%s%s.%s', $association, Kernel::MAJOR_VERSION > 5 ? '?' : '', $property),
31+
static fn (string $property): string => \sprintf('%s?.%s', $association, $property),
3432
$this->properties,
3533
),
3634
);

src/Command/DebugCommand.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,12 @@ protected function configure(): void
4141
'mode' => InputArgument::OPTIONAL,
4242
'description' => 'The entity name or a substring of its name',
4343
'default' => null,
44+
'suggestedValues' => array_keys($this->getEntityCollection()),
4445
];
4546

46-
if (Kernel::MAJOR_VERSION >= 7 || (Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION >= 1)) {
47-
$params['suggestedValues'] = array_keys($this->getEntityCollection());
48-
49-
if (Kernel::MAJOR_VERSION === 6) {
50-
// cannot use named arguments with SF6
51-
$params = array_values($params);
52-
}
47+
if (Kernel::MAJOR_VERSION === 6) {
48+
// cannot use named arguments with SF6
49+
$params = array_values($params);
5350
}
5451

5552
$this->addArgument(...$params);

src/DependencyInjection/CompilerPass/RegisterExpressionLanguageProvidersPass.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use Symfony\Component\DependencyInjection\ContainerBuilder;
1111
use Symfony\Component\DependencyInjection\Definition;
1212
use Symfony\Component\DependencyInjection\Reference;
13-
use Symfony\Component\HttpKernel\Kernel;
1413

1514
final class RegisterExpressionLanguageProvidersPass implements CompilerPassInterface
1615
{
@@ -36,11 +35,6 @@ public function process(ContainerBuilder $container): void
3635
$functionReferences[$function] = (new Definition(\Closure::class, [[new Reference($id), $method]]))
3736
->setFactory([\Closure::class, 'fromCallable']);
3837

39-
if (Kernel::MAJOR_VERSION <= 5) {
40-
$container->setDefinition($factoryId = $id.'.'.$method.'.factory', $functionReferences[$function]);
41-
$functionReferences[$function] = new Reference($factoryId);
42-
}
43-
4438
$usedFunctionNames[$function] = \sprintf('%s::%s', $id, $method);
4539
}
4640
}

0 commit comments

Comments
 (0)