Skip to content

Commit

Permalink
Prepare for symfony 5 and PHP8 (#14)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
toooni committed Feb 1, 2021
1 parent c333b02 commit e8a865f
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 27 deletions.
23 changes: 14 additions & 9 deletions .travis.yml
Expand Up @@ -4,28 +4,33 @@ language: php

php:
- 7.4
- 8.0

env:
global:
- deps=high
- XDEBUG_MODE=coverage
- SYMFONY_DEPRECATIONS_HELPER=weak

matrix:
fast_finish: true
include:
- php: 7.4
env: DEPENDENCIES=beta

before_install:
- if [ "$DEPENDENCIES" = "beta" ]; then composer config minimum-stability beta; fi;
env: deps=low
- php: 8.0
env: deps=low

install:
- if [ "$deps" = "no" ]; then composer install; fi
- if [ "$deps" = "low" ]; then composer update --prefer-lowest; fi
- if [ "$deps" = "high" ]; then composer update; fi
- |
# Installing dependencies ...
if [[ $deps = "low" ]]; then
composer update --prefer-dist --prefer-lowest
else
composer install --prefer-dist
fi
script:
- mkdir -p build/logs
- vendor/bin/phpunit --coverage-clover build/logs/clover.xml

after_script:
- php vendor/bin/coveralls -v
- php vendor/bin/php-coveralls -v
4 changes: 2 additions & 2 deletions DependencyInjection/Configuration.php
Expand Up @@ -17,8 +17,8 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('w3_c_lifecycle_events');
$treeBuilder = new TreeBuilder('w3_c_lifecycle_events');
$rootNode = $treeBuilder->getRootNode();

$rootNode
->children()
Expand Down
2 changes: 1 addition & 1 deletion Event/LifecycleEvent.php
Expand Up @@ -2,7 +2,7 @@

namespace W3C\LifecycleEventsBundle\Event;

use Symfony\Component\EventDispatcher\Event;
use Symfony\Contracts\EventDispatcher\Event;

/**
* LifecycleEvent is used when an entity is created
Expand Down
2 changes: 1 addition & 1 deletion Event/PreAutoDispatchEvent.php
Expand Up @@ -2,7 +2,7 @@

namespace W3C\LifecycleEventsBundle\Event;

use Symfony\Component\EventDispatcher\Event;
use Symfony\Contracts\EventDispatcher\Event;
use W3C\LifecycleEventsBundle\Services\LifecycleEventsDispatcher;

/**
Expand Down
2 changes: 1 addition & 1 deletion Tests/Services/Events/MyCollectionChangedEvent.php
Expand Up @@ -2,7 +2,7 @@

namespace W3C\LifecycleEventsBundle\Tests\Services\Events;

use Symfony\Component\EventDispatcher\Event;
use Symfony\Contracts\EventDispatcher\Event;

/**
* @author Jean-Guilhem Rouel <jean-gui@w3.org>
Expand Down
2 changes: 1 addition & 1 deletion Tests/Services/Events/MyLifecycleEvent.php
Expand Up @@ -2,7 +2,7 @@

namespace W3C\LifecycleEventsBundle\Tests\Services\Events;

use Symfony\Component\EventDispatcher\Event;
use Symfony\Contracts\EventDispatcher\Event;

/**
* @author Jean-Guilhem Rouel <jean-gui@w3.org>
Expand Down
2 changes: 1 addition & 1 deletion Tests/Services/Events/MyPropertyChangedEvent.php
Expand Up @@ -2,7 +2,7 @@

namespace W3C\LifecycleEventsBundle\Tests\Services\Events;

use Symfony\Component\EventDispatcher\Event;
use Symfony\Contracts\EventDispatcher\Event;

/**
* @author Jean-Guilhem Rouel <jean-gui@w3.org>
Expand Down
2 changes: 1 addition & 1 deletion Tests/Services/Events/MyUpdatedEvent.php
Expand Up @@ -2,7 +2,7 @@

namespace W3C\LifecycleEventsBundle\Tests\Services\Events;

use Symfony\Component\EventDispatcher\Event;
use Symfony\Contracts\EventDispatcher\Event;

/**
* @author Jean-Guilhem Rouel <jean-gui@w3.org>
Expand Down
20 changes: 10 additions & 10 deletions composer.json
Expand Up @@ -12,19 +12,19 @@
}
],
"require": {
"php": ">=7.4",
"symfony/http-kernel": "^4.3",
"symfony/config": "^4.3",
"symfony/dependency-injection": "^4.3",
"symfony/yaml": "^4.3",
"symfony/event-dispatcher": "^4.3",
"php": ">=7.4|>=8.0",
"symfony/http-kernel": "^4.4|^5.0",
"symfony/config": "^4.4|^5.0",
"symfony/dependency-injection": "^4.4|^5.0",
"symfony/yaml": "^4.4|^5.0",
"symfony/event-dispatcher": "^4.4|^5.0",
"doctrine/orm": "^2.0",
"doctrine/persistence": "^2.0"
"doctrine/persistence": "^1.3|^2.0"
},
"require-dev": {
"phpunit/phpunit": "^8.2.3",
"symfony/phpunit-bridge": "^3.1",
"satooshi/php-coveralls": "^2.0"
"phpunit/phpunit": "^9.2.4",
"symfony/phpunit-bridge": "^4.4|^5.0",
"php-coveralls/php-coveralls": "^2.0"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit e8a865f

Please sign in to comment.