Skip to content

Commit

Permalink
Drop SF 2 and add SF 4 compatibility (#32)
Browse files Browse the repository at this point in the history
* Drop SF 2 and add SF 4 compatibility

* Add dev dependency on prophecy and update tests fixtures
  • Loading branch information
pyrech authored Jan 2, 2018
1 parent c466605 commit 0548479
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 53 deletions.
45 changes: 26 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,43 @@
language: php

sudo: false
php:
- 7.0
- 7.1

cache:
directories:
- $HOME/.composer/cache
env:
global:
- TARGET=test
- SYMFONY_PHPUNIT_REMOVE="symfony/yaml"

matrix:
fast_finish: true
include:
- php: 7.0
env: check_cs=true
env: TARGET=cs_dry_run
- php: 7.0
env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_DEPRECATIONS_HELPER=weak
# test 3.4 LTS
- php: 7.0
env: deps=low
env: SYMFONY_VERSION=3.4.*
# test the latest release (including beta releases)
- php: 7.1
env: deps=high
env: DEPENDENCIES=beta

env:
global:
- deps=high
- check_cs=false
- SYMFONY_PHPUNIT_REMOVE="symfony/yaml"
sudo: false

cache:
directories:
- $HOME/.composer/cache

install:
- if [ "$deps" = "low" ]; then composer --prefer-dist --prefer-lowest update; fi;
- if [ "$deps" != "low" ]; then composer --prefer-dist update; fi;
before_install:
- if [ "$DEPENDENCIES" = "beta" ]; then perl -pi -e 's/^}$/,"minimum-stability":"beta"}/' composer.json; fi;
- if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update; fi;
- echo "memory_limit=2G" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini;

before_script:
- composer install --no-interaction
install: composer update --prefer-dist --no-interaction $COMPOSER_FLAGS

script:
- vendor/bin/simple-phpunit
- if [ "$check_cs" = "true" ]; then vendor/bin/php-cs-fixer fix --config=.php_cs --dry-run --diff; fi;
- make $TARGET

branches:
only:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changes between versions

## Not yet released

* Dropped compatibility with Symfony < 3.0
* Added compatibility with Symfony 4.0

## 0.5.1 (2017-12-28)

* Fix Symfony 3.4 / 4.0 compatibility with DataCollector
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ changes, improvements or alternatives may be given).
Run the tests using the following script:

```shell
composer test
make test
```

## Standard code
Expand All @@ -57,7 +57,7 @@ Use [PHP CS fixer](http://cs.sensiolabs.org/) to make your code compliant with
this project's coding standards:

```shell
vendor/bin/php-cs-fixer fix .
make cs
```

## Keeping your fork up-to-date
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cs:
./vendor/bin/php-cs-fixer fix --verbose

cs_dry_run:
./vendor/bin/php-cs-fixer fix --verbose --dry-run

test:
./vendor/bin/simple-phpunit
21 changes: 9 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@
"doctrine/doctrine-bundle": "~1.6",
"doctrine/orm": "~2.5",
"friendsofphp/php-cs-fixer": "~2.2",
"symfony/config": "~2.7|~3.0",
"symfony/dependency-injection": "~2.7|~3.0",
"symfony/framework-bundle": "~2.7.25|~2.8.15|~3.0",
"symfony/http-kernel": "~2.7|~3.0",
"symfony/phpunit-bridge": "^3.3",
"symfony/twig-bundle": "~2.7|~3.0",
"symfony/yaml": "~2.7|~3.0"
"phpdocumentor/reflection-docblock": "^4.0",
"phpspec/prophecy": "^1.7",
"symfony/config": "~3.0|~4.0",
"symfony/dependency-injection": "~3.0|~4.0",
"symfony/framework-bundle": "~3.0|~4.0",
"symfony/http-kernel": "~3.0|~4.0",
"symfony/phpunit-bridge": "^3.3|~4.0",
"symfony/twig-bundle": "~3.0|~4.0",
"symfony/yaml": "~3.0|~4.0"
},
"config": {
"sort-packages": true
Expand All @@ -47,10 +49,5 @@
"branch-alias": {
"dev-master": "0.x-dev"
}
},
"scripts": {
"test": [
"SYMFONY_PHPUNIT_REMOVE=\"symfony/yaml\" vendor/bin/simple-phpunit"
]
}
}
1 change: 1 addition & 0 deletions src/Bridge/Symfony/Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:

seo_override.subscriber:
class: Joli\SeoOverride\Bridge\Symfony\Subscriber\SeoSubscriber
public: true
arguments:
- '@seo_override.manager'
- '@seo_override.blacklister.default' # Service declared in the DIC extension
Expand Down
6 changes: 1 addition & 5 deletions tests/Functional/Fixtures/symfony/app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ public function getLogDir()

public function registerContainerConfiguration(LoaderInterface $loader)
{
if (version_compare(self::VERSION, '3.0.0', '<')) {
$loader->load($this->getRootDir().'/config/config_lower_than_3-0.yml');
} else {
$loader->load($this->getRootDir().'/config/config_greater_than_3-0.yml');
}
$loader->load($this->getRootDir().'/config/config.yml');
}
}

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion tests/Functional/Fixtures/symfony/app/config/routing.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
index:
path: /
defaults:
_controller: FrameworkBundle:Template:template
_controller: app.controller:templateAction
template: index.html.twig

error:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

class AppController extends Controller
{
public function templateAction(string $template)
{
return new Response($this->renderView($template), 200);
}

public function errorAction()
{
return new Response($this->renderView('error.html.twig'), 400);
Expand Down

0 comments on commit 0548479

Please sign in to comment.