Skip to content

Commit 14e0c3c

Browse files
committed
dropped support for Symfony 4.4, 6.3, 7.0, 7.1
1 parent 4c2489a commit 14e0c3c

21 files changed

Lines changed: 39 additions & 317 deletions

.github/workflows/composer-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
matrix:
1414
php:
15-
- '8.2'
15+
- '8.4'
1616

1717
steps:
1818
- name: checkout

.github/workflows/static-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
matrix:
1414
php:
15-
- '8.2'
15+
- '8.4'
1616

1717
steps:
1818
- name: checkout

.github/workflows/tests.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,15 @@ jobs:
3030
-
3131
php: '8.4'
3232
dependencies: highest
33-
-
34-
php: '7.3'
35-
symfony: '4.4.*'
36-
-
37-
php: '7.4'
38-
symfony: '5.4.*'
39-
# TODO remove as soon as Symfony >= 5.0 is required
4033
-
4134
php: '7.4'
4235
symfony: '5.4.*'
43-
note: contao-polyfill-symfony
44-
contao-polyfill-symfony: true
4536
-
4637
php: '8.0'
4738
symfony: '5.4.*'
4839
-
4940
php: '8.1'
5041
symfony: '5.4.*'
51-
-
52-
php: '8.1'
53-
symfony: '6.3.*'
5442
-
5543
php: '8.2'
5644
symfony: '6.4.*'
@@ -111,11 +99,6 @@ jobs:
11199
env:
112100
fail-fast: true # interrupt on extension setup error
113101

114-
# TODO remove as soon as Symfony >= 5.0 is required
115-
- name: require contao/polyfill-symfony
116-
if: matrix.contao-polyfill-symfony == true
117-
run: composer require --no-update --dev contao/polyfill-symfony
118-
119102
- name: use dev dependencies
120103
if: matrix.stability == 'dev'
121104
run: composer config minimum-stability dev

CraueFormFlowBundle.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22

33
namespace Craue\FormFlowBundle;
44

5-
use Craue\FormFlowBundle\DependencyInjection\Compiler\LegacySessionCompilerPass;
65
use Craue\FormFlowBundle\Util\TempFileUtil;
7-
use Symfony\Component\DependencyInjection\ContainerBuilder;
8-
use Symfony\Component\HttpFoundation\RequestStack;
96
use Symfony\Component\HttpKernel\Bundle\Bundle;
107

118
/**
@@ -28,15 +25,4 @@ public function boot() {
2825
});
2926
}
3027

31-
/**
32-
* {@inheritDoc}
33-
*/
34-
public function build(ContainerBuilder $container) : void {
35-
parent::build($container);
36-
37-
if (!\method_exists(RequestStack::class, 'getSession')) {
38-
$container->addCompilerPass(new LegacySessionCompilerPass());
39-
}
40-
}
41-
4228
}

DependencyInjection/Compiler/LegacySessionCompilerPass.php

Lines changed: 0 additions & 28 deletions
This file was deleted.

EventListener/EventListenerWithTranslatorTrait.php

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace Craue\FormFlowBundle\EventListener;
44

5-
use Craue\FormFlowBundle\Exception\InvalidTypeException;
6-
use Symfony\Component\Translation\TranslatorInterface as LegacyTranslatorInterface;
75
use Symfony\Contracts\Translation\TranslatorInterface;
86

97
/**
@@ -16,23 +14,15 @@
1614
trait EventListenerWithTranslatorTrait {
1715

1816
/**
19-
* @var TranslatorInterface|LegacyTranslatorInterface
17+
* @var TranslatorInterface
2018
*/
2119
protected $translator;
2220

2321
/**
24-
* @param TranslatorInterface|LegacyTranslatorInterface $translator
25-
* @throws InvalidTypeException
22+
* @param TranslatorInterface $translator
2623
*/
27-
public function setTranslator($translator) {
28-
// TODO revert to type-hint with only TranslatorInterface as soon as Symfony >= 5.0 is required
29-
if ($translator instanceof TranslatorInterface || $translator instanceof LegacyTranslatorInterface) {
30-
$this->translator = $translator;
31-
32-
return;
33-
}
34-
35-
throw new InvalidTypeException($translator, [TranslatorInterface::class, LegacyTranslatorInterface::class]);
24+
public function setTranslator(TranslatorInterface $translator) {
25+
$this->translator = $translator;
3626
}
3727

3828
}

Form/FormFlow.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -705,12 +705,7 @@ public function saveCurrentStepData(FormInterface $form) {
705705
$request = $this->getRequest();
706706
$formName = $form->getName();
707707

708-
if (!\class_exists('Symfony\Component\HttpFoundation\InputBag')) {
709-
// TODO remove as soon as Symfony >= 5.1 is required
710-
$currentStepData = $request->request->get($formName, []);
711-
} else {
712-
$currentStepData = $request->request->all($formName);
713-
}
708+
$currentStepData = $request->request->all($formName);
714709

715710
if ($this->handleFileUploads) {
716711
$currentStepData = array_replace_recursive($currentStepData, $request->files->get($formName, []));

Storage/SessionProviderTrait.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ private function setRequestStackOrSession($requestStackOrSession) : void {
3838
return;
3939
}
4040

41-
// TODO remove as soon as Symfony >= 5.3 is required
42-
if (!\method_exists(RequestStack::class, 'getSession')) {
43-
throw new InvalidTypeException($requestStackOrSession, SessionInterface::class);
44-
}
45-
4641
if ($requestStackOrSession instanceof RequestStack) {
4742
$this->requestStack = $requestStackOrSession;
4843

Storage/UserSessionStorageKeyGenerator.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,8 @@ public function generate($key) {
5151

5252
// TODO remove checks for AnonymousToken as soon as Symfony >= 6.0 is required
5353
if ($token instanceof TokenInterface && (!\class_exists(AnonymousToken::class) || !$token instanceof AnonymousToken)) {
54-
// TODO just call `getUserIdentifier()` as soon as Symfony >= 5.3 is required
55-
$userIdentifier = \method_exists($token, 'getUserIdentifier') ? $token->getUserIdentifier() : $token->getUsername();
56-
if (is_string($userIdentifier) && $userIdentifier !== '') {
54+
$userIdentifier = $token->getUserIdentifier();
55+
if ($userIdentifier !== '') {
5756
return sprintf('user_%s_%s', $userIdentifier, $key);
5857
}
5958
}

Tests/EventListener/EventListenerWithTranslatorTestTrait.php

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)