Skip to content

Commit 2608312

Browse files
committed
Fix Symfony 6 strict compatibility
1 parent 64d49c3 commit 2608312

File tree

6 files changed

+30
-32
lines changed

6 files changed

+30
-32
lines changed

.travis.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ env:
1515
- SYMFONY_VERSION=""
1616

1717
php:
18-
- 7.2
19-
- 7.3
2018
- 7.4
19+
- 8.0
20+
- 8.1
2121

2222
services:
2323
- mongodb
@@ -26,28 +26,28 @@ matrix:
2626
fast_finish: true
2727
include:
2828
# no flag build with code coverage:
29-
- php: 7.4
29+
- php: 8.1
3030
env: ENABLE_CODE_COVERAGE="yes"
3131
# --ignore-platform-reqs for ruflin/elastica:6 which doesn't support PHP8
3232
- php: 8.0
3333
env: COMPOSER_FLAGS="--ignore-platform-reqs"
3434
- php: nightly
3535
env: COMPOSER_FLAGS="--ignore-platform-reqs"
3636
# normal build
37-
- php: 7.2
37+
- php: 7.4
3838
env:
3939
- COMPOSER_FLAGS="--prefer-lowest"
4040
- SYMFONY_DEPRECATIONS_HELPER=weak
4141
- php: 7.4
4242
env:
43-
- SYMFONY_VERSION=^4.4
43+
- SYMFONY_VERSION=^5.4
4444
- SYMFONY_DEPRECATIONS_HELPER=weak
45-
- php: 8.0snapshot
45+
- php: 8.2snapshot
4646
env:
4747
- DEPENDENCIES=dev
4848
- COMPOSER_FLAGS="--ignore-platform-reqs"
4949
allow_failures:
50-
- php: 8.0snapshot
50+
- php: 8.2snapshot
5151

5252
before_install:
5353
- if [ "$DEPENDENCIES" != "" ]; then composer config minimum-stability ${DEPENDENCIES}; fi;

composer.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
"issues": "https://github.com/omines/datatables-bundle/issues"
2121
},
2222
"require": {
23-
"php": ">=7.2",
24-
"symfony/event-dispatcher": "^4.4|^5.0|^6.0",
25-
"symfony/framework-bundle": "^4.4|^5.0|^6.0",
26-
"symfony/options-resolver": "^4.4|^5.0|^6.0",
27-
"symfony/property-access": "^4.4|^5.0|^6.0",
28-
"symfony/translation": "^4.4|^5.0|^6.0"
23+
"php": ">=8.0",
24+
"symfony/event-dispatcher": "^5.4|^6.0",
25+
"symfony/framework-bundle": "^5.4|^6.0",
26+
"symfony/options-resolver": "^5.4|^6.0",
27+
"symfony/property-access": "^5.4|^6.0",
28+
"symfony/translation": "^5.4|^6.0"
2929
},
3030
"require-dev": {
3131
"ext-curl": "*",
@@ -41,15 +41,15 @@
4141
"ocramius/package-versions": "^1.4",
4242
"phpoffice/phpspreadsheet": "^1.6",
4343
"ruflin/elastica": "^6.0|^7.0",
44-
"symfony/browser-kit": "^4.4|^5.0|^6.0",
45-
"symfony/css-selector": "^4.4|^5.0|^6.0",
46-
"symfony/dom-crawler": "^4.4|^5.0|^6.0",
47-
"symfony/intl": "^4.4|^5.0|^6.0",
48-
"symfony/mime": "^4.4|^5.0|^6.0",
49-
"symfony/phpunit-bridge": "^4.4|^5.0|^6.0",
50-
"symfony/twig-bundle": "^4.4|^5.0|^6.0",
51-
"symfony/var-dumper": "^4.4|^5.0|^6.0",
52-
"symfony/yaml": "^4.4|^5.0|^6.0"
44+
"symfony/browser-kit": "^5.4|^6.0",
45+
"symfony/css-selector": "^5.4|^6.0",
46+
"symfony/dom-crawler": "^5.4|^6.0",
47+
"symfony/intl": "^5.4|^6.0",
48+
"symfony/mime": "^5.4|^6.0",
49+
"symfony/phpunit-bridge": "^5.4|^6.0",
50+
"symfony/twig-bundle": "^5.4|^6.0",
51+
"symfony/var-dumper": "^5.4|^6.0",
52+
"symfony/yaml": "^5.4|^6.0"
5353
},
5454
"suggest": {
5555
"doctrine/doctrine-bundle": "For integrated access to Doctrine object managers",
@@ -71,7 +71,7 @@
7171
},
7272
"extra": {
7373
"branch-alias": {
74-
"dev-master": "0.5-dev"
74+
"dev-master": "0.6-dev"
7575
}
7676
}
7777
}

src/DataTablesBundle.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Omines\DataTablesBundle\DependencyInjection\Compiler\LocatorRegistrationPass;
1616
use Omines\DataTablesBundle\DependencyInjection\DataTablesExtension;
1717
use Symfony\Component\DependencyInjection\ContainerBuilder;
18+
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
1819
use Symfony\Component\HttpKernel\Bundle\Bundle;
1920

2021
/**
@@ -37,7 +38,7 @@ public function build(ContainerBuilder $container)
3738
/**
3839
* {@inheritdoc}
3940
*/
40-
public function getContainerExtension()
41+
public function getContainerExtension(): ?ExtensionInterface
4142
{
4243
return new DataTablesExtension();
4344
}

src/DependencyInjection/DataTablesExtension.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,7 @@ public function load(array $configs, ContainerBuilder $container)
6060
->addTag('datatables.exporter');
6161
}
6262

63-
/**
64-
* @return string
65-
*/
66-
public function getAlias()
63+
public function getAlias(): string
6764
{
6865
// Default would underscore the camelcase unintuitively
6966
return 'datatables';

tests/Fixtures/AppKernel.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
class AppKernel extends Kernel
2424
{
25-
public function registerBundles()
25+
public function registerBundles(): array
2626
{
2727
return [
2828
new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
@@ -38,12 +38,12 @@ public function registerContainerConfiguration(LoaderInterface $loader)
3838
$loader->load(__DIR__ . '/config.yml');
3939
}
4040

41-
public function getRootDir()
41+
public function getRootDir(): string
4242
{
4343
return __DIR__ . '/../../tmp';
4444
}
4545

46-
public function getProjectDir()
46+
public function getProjectDir(): string
4747
{
4848
return __DIR__;
4949
}

tests/Functional/FunctionalTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ private function assertSuccessful(Response $response)
229229
}
230230
}
231231

232-
protected static function getKernelClass()
232+
protected static function getKernelClass(): string
233233
{
234234
return AppKernel::class;
235235
}

0 commit comments

Comments
 (0)