Skip to content

Commit e8a865f

Browse files
authored
Prepare for symfony 5 and PHP8 (#14)
* Prepare for symfony 5 and PHP8 * TravisCI: Removed min-stablity beta, use deps high and low * Added low for 7.4 and 8.0 * Fix dependencies and improve travisci config * Raised PHPUnit version * Added XDEBUG_MODE=coverage * Fix coveralls script name * Allow deprecations
1 parent c333b02 commit e8a865f

File tree

9 files changed

+32
-27
lines changed

9 files changed

+32
-27
lines changed

.travis.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,33 @@ language: php
44

55
php:
66
- 7.4
7+
- 8.0
78

89
env:
910
global:
10-
- deps=high
11+
- XDEBUG_MODE=coverage
12+
- SYMFONY_DEPRECATIONS_HELPER=weak
1113

1214
matrix:
1315
fast_finish: true
1416
include:
1517
- php: 7.4
16-
env: DEPENDENCIES=beta
17-
18-
before_install:
19-
- if [ "$DEPENDENCIES" = "beta" ]; then composer config minimum-stability beta; fi;
18+
env: deps=low
19+
- php: 8.0
20+
env: deps=low
2021

2122
install:
22-
- if [ "$deps" = "no" ]; then composer install; fi
23-
- if [ "$deps" = "low" ]; then composer update --prefer-lowest; fi
24-
- if [ "$deps" = "high" ]; then composer update; fi
23+
- |
24+
# Installing dependencies ...
25+
if [[ $deps = "low" ]]; then
26+
composer update --prefer-dist --prefer-lowest
27+
else
28+
composer install --prefer-dist
29+
fi
2530
2631
script:
2732
- mkdir -p build/logs
2833
- vendor/bin/phpunit --coverage-clover build/logs/clover.xml
2934

3035
after_script:
31-
- php vendor/bin/coveralls -v
36+
- php vendor/bin/php-coveralls -v

DependencyInjection/Configuration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class Configuration implements ConfigurationInterface
1717
*/
1818
public function getConfigTreeBuilder()
1919
{
20-
$treeBuilder = new TreeBuilder();
21-
$rootNode = $treeBuilder->root('w3_c_lifecycle_events');
20+
$treeBuilder = new TreeBuilder('w3_c_lifecycle_events');
21+
$rootNode = $treeBuilder->getRootNode();
2222

2323
$rootNode
2424
->children()

Event/LifecycleEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace W3C\LifecycleEventsBundle\Event;
44

5-
use Symfony\Component\EventDispatcher\Event;
5+
use Symfony\Contracts\EventDispatcher\Event;
66

77
/**
88
* LifecycleEvent is used when an entity is created

Event/PreAutoDispatchEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace W3C\LifecycleEventsBundle\Event;
44

5-
use Symfony\Component\EventDispatcher\Event;
5+
use Symfony\Contracts\EventDispatcher\Event;
66
use W3C\LifecycleEventsBundle\Services\LifecycleEventsDispatcher;
77

88
/**

Tests/Services/Events/MyCollectionChangedEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace W3C\LifecycleEventsBundle\Tests\Services\Events;
44

5-
use Symfony\Component\EventDispatcher\Event;
5+
use Symfony\Contracts\EventDispatcher\Event;
66

77
/**
88
* @author Jean-Guilhem Rouel <jean-gui@w3.org>

Tests/Services/Events/MyLifecycleEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace W3C\LifecycleEventsBundle\Tests\Services\Events;
44

5-
use Symfony\Component\EventDispatcher\Event;
5+
use Symfony\Contracts\EventDispatcher\Event;
66

77
/**
88
* @author Jean-Guilhem Rouel <jean-gui@w3.org>

Tests/Services/Events/MyPropertyChangedEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace W3C\LifecycleEventsBundle\Tests\Services\Events;
44

5-
use Symfony\Component\EventDispatcher\Event;
5+
use Symfony\Contracts\EventDispatcher\Event;
66

77
/**
88
* @author Jean-Guilhem Rouel <jean-gui@w3.org>

Tests/Services/Events/MyUpdatedEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace W3C\LifecycleEventsBundle\Tests\Services\Events;
44

5-
use Symfony\Component\EventDispatcher\Event;
5+
use Symfony\Contracts\EventDispatcher\Event;
66

77
/**
88
* @author Jean-Guilhem Rouel <jean-gui@w3.org>

composer.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212
}
1313
],
1414
"require": {
15-
"php": ">=7.4",
16-
"symfony/http-kernel": "^4.3",
17-
"symfony/config": "^4.3",
18-
"symfony/dependency-injection": "^4.3",
19-
"symfony/yaml": "^4.3",
20-
"symfony/event-dispatcher": "^4.3",
15+
"php": ">=7.4|>=8.0",
16+
"symfony/http-kernel": "^4.4|^5.0",
17+
"symfony/config": "^4.4|^5.0",
18+
"symfony/dependency-injection": "^4.4|^5.0",
19+
"symfony/yaml": "^4.4|^5.0",
20+
"symfony/event-dispatcher": "^4.4|^5.0",
2121
"doctrine/orm": "^2.0",
22-
"doctrine/persistence": "^2.0"
22+
"doctrine/persistence": "^1.3|^2.0"
2323
},
2424
"require-dev": {
25-
"phpunit/phpunit": "^8.2.3",
26-
"symfony/phpunit-bridge": "^3.1",
27-
"satooshi/php-coveralls": "^2.0"
25+
"phpunit/phpunit": "^9.2.4",
26+
"symfony/phpunit-bridge": "^4.4|^5.0",
27+
"php-coveralls/php-coveralls": "^2.0"
2828
},
2929
"autoload": {
3030
"psr-4": {

0 commit comments

Comments
 (0)