From ea811f3847f953298de4a5e5373ef525430fae9f Mon Sep 17 00:00:00 2001 From: Maxime Veber Date: Tue, 12 Dec 2017 10:42:51 +0100 Subject: [PATCH 1/4] Prepare release 2.0 - Add changelog - Add BiiG team to `composer.json` and `README.md` - Upgrade to Symfony4 --- .travis.yml | 16 +++++++--------- CHANGELOG.md | 24 ++++++++++++++++++++++++ Dockerfile | 3 +++ README.md | 33 ++++++++++++++++++++++++++++----- composer.json | 16 ++++++++++------ 5 files changed, 72 insertions(+), 20 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 Dockerfile diff --git a/.travis.yml b/.travis.yml index 5f5a5b93..bb2213b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,10 @@ language: php php: - - 5.4 - - 5.5 - 5.6 - 7.0 - 7.1 + - 7.2 cache: directories: @@ -17,20 +16,19 @@ cache: matrix: include: - - php: 5.4 - env: 'COMPOSER_FLAGS="--prefer-lowest --prefer-stable"' - - php: 5.5 - env: 'COMPOSER_FLAGS="--prefer-lowest --prefer-stable"' - php: 5.6 env: 'COMPOSER_FLAGS="--prefer-lowest --prefer-stable"' - php: 7.0 env: 'COMPOSER_FLAGS="--prefer-lowest --prefer-stable"' - php: 7.1 env: 'COMPOSER_FLAGS="--prefer-lowest --prefer-stable"' + - php: 7.2 + env: 'COMPOSER_FLAGS="--prefer-lowest --prefer-stable"' -# branches: -# only: -# - master +branches: + only: + - master + - 1.x before_script: diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..582009ed --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,24 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [2.0.0] - 2017-12-12 +### Added +- Add tag `knp_dictionary.factory` for DI services so you can add dictionary factories +- Add tag `knp_dictionary.dictionary` for DI services so you can add dictionary as service +- Add `knp_dictionary.data_collector.dictionary_data_collector` service so you can trace what dictionnary is available +- New factory interface `Knp\DictionaryBundle\Dictionary\Factory` +- New interface `Knp\DictionaryBundle\Dictionary` +- This changelog is also new :) + +### Changed +- Some namespace changes for `SimpleDictionary` and `ValueTransformer` +- Add `add` method on `DictionaryRegistry` +- New view in the web profiler of Symfony + +### Removed +- `service` and `method` nodes from configuration: dictionnaries are now loaded automatically by factories registered as it with the new tag diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..eb4674e5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM php:7.2.0-cli-stretch + +RUN pecl install xdebug-2.6.0alpha1 && docker-php-ext-enable xdebug diff --git a/README.md b/README.md index 3873b2ed..3ff86343 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,30 @@ DictionaryBundle Are you often tired to repeat static choices like gender or civility in your apps ? + +## This is a fork + +This bundle is a fork. The motivation for forking it is the following: +- Getting a stable release (2.0) +- Adding Symfony 4 compatibility +- Ensure a future maintenance of the project + +As today we still hope that the main project will reborn. There is also a lot of work to achieve +to release all unreleased features. + +That's why to install this fork you need to add the following lines to your `composer.json` file. + +```json +{ + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/biig-io/DictionaryBundle" + } + ] +} +``` + ## Requirements - Symfony >= 2.8 @@ -30,9 +54,8 @@ $bundles = array( You can ping us if need some reviews/comments/help: - - [@AntoineLelaisant](https://github.com/AntoineLelaisant) - - [@PedroTroller](https://github.com/PedroTroller) - - [@Shivoham](https://github.com/Shivoham) + - [@Nek-](https://github.com/Nek-) + - [@babeou](https://github.com/babeou) ## Basic usage Define dictionaries in your config.yml file: @@ -43,7 +66,7 @@ knp_dictionary: - Foo # your dictionary content - Bar - Baz - + ``` You will be able to retreive it trough the dictionary registry service: ```php @@ -172,7 +195,7 @@ The KnpDictionaryBundle comes with a [faker provider](https://github.com/fzanino ### Alice -To register the provider in [nelmio/alice](https://github.com/nelmio/alice), you can follow the [official documentation](https://github.com/nelmio/alice/blob/master/doc/customizing-data-generation.md#add-a-custom-faker-provider-class) +To register the provider in [nelmio/alice](https://github.com/nelmio/alice), you can follow the [official documentation](https://github.com/nelmio/alice/blob/master/doc/customizing-data-generation.md#add-a-custom-faker-provider-class) or ... diff --git a/composer.json b/composer.json index 12957971..8ad32648 100644 --- a/composer.json +++ b/composer.json @@ -9,6 +9,10 @@ "name": "Knplabs", "homepage": "http://knplabs.com" }, + { + "name": "BiiG", + "homepage": "https://www.biig.fr" + }, { "name": "Shivoham", "homepage": "https://github.com/Shivoham" @@ -21,12 +25,12 @@ "minimum-stability": "stable", "require": { "php": ">=5.4", - "symfony/http-kernel": "~2.8 || ~3.0", - "symfony/dependency-injection": "~2.8 || ~3.0", - "symfony/http-foundation": "~2.8 || ~3.0", - "symfony/config": "~2.8 || ~3.0", - "symfony/form": "~2.8 || ~3.0", - "symfony/validator": "~2.8 || ~3.0", + "symfony/http-kernel": "~2.8 || ~3.0 || ~4.0", + "symfony/dependency-injection": "~2.8 || ~3.0 || ~4.0", + "symfony/http-foundation": "~2.8 || ~3.0 || ~4.0", + "symfony/config": "~2.8 || ~3.0 || ~4.0", + "symfony/form": "~2.8 || ~3.0 || ~4.0", + "symfony/validator": "~2.8 || ~3.0 || ~4.0", "twig/twig": "~1.12|~2.0", "fzaninotto/faker": "^1.5" }, From cc65ba1029b0e2e57492251036a8f2add201970c Mon Sep 17 00:00:00 2001 From: Maxime Veber Date: Tue, 12 Dec 2017 11:04:08 +0100 Subject: [PATCH 2/4] Add notice about xdebug for the test suite This is done because the error if you didn't install xdebug is not obvious. --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 2406f74c..48bc64cc 100644 --- a/Makefile +++ b/Makefile @@ -2,4 +2,5 @@ fix: bin/php-cs-fixer --diff -v fix test: + echo "⚠ You need x-debug to run this test suite." bin/phpspec run -fpretty From b8af7d4cf324f68f19e9f241a921b737b003432c Mon Sep 17 00:00:00 2001 From: Maxime Veber Date: Tue, 12 Dec 2017 11:10:01 +0100 Subject: [PATCH 3/4] Fix travis file & trigger it --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bb2213b8..07d3fee3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,6 @@ branches: - master - 1.x - before_script: - composer update --prefer-source $COMPOSER_FLAGS From 25fb3aa2d8dce313d1b0ee92dcaad5c11b35f633 Mon Sep 17 00:00:00 2001 From: Maxime Veber Date: Tue, 12 Dec 2017 12:06:25 +0100 Subject: [PATCH 4/4] Fix test suite for PHP 7.2 --- .travis.yml | 2 -- composer.json | 7 ++++--- phpspec.yml | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 07d3fee3..955c7fd7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,8 +22,6 @@ matrix: env: 'COMPOSER_FLAGS="--prefer-lowest --prefer-stable"' - php: 7.1 env: 'COMPOSER_FLAGS="--prefer-lowest --prefer-stable"' - - php: 7.2 - env: 'COMPOSER_FLAGS="--prefer-lowest --prefer-stable"' branches: only: diff --git a/composer.json b/composer.json index 8ad32648..57c9acfd 100644 --- a/composer.json +++ b/composer.json @@ -35,10 +35,11 @@ "fzaninotto/faker": "^1.5" }, "require-dev": { - "bossa/phpspec2-expect": "~1.0", - "henrikbjorn/phpspec-code-coverage": "^2.1", + "bossa/phpspec2-expect": "~2.0", + "henrikbjorn/phpspec-code-coverage": "dev-master", + "phpunit/php-code-coverage": "^5.0|^4.0", "pedrotroller/php-cs-custom-fixer": "~1.4.0", - "phpspec/phpspec": "~2.5", + "phpspec/phpspec": "~3.0", "phpspec/prophecy": "~1.6" }, "config": { diff --git a/phpspec.yml b/phpspec.yml index 44307e2c..809b7e94 100644 --- a/phpspec.yml +++ b/phpspec.yml @@ -1,7 +1,7 @@ formatter.name: pretty extensions: - - PhpSpec\Extension\CodeCoverageExtension + PhpSpecCodeCoverage\CodeCoverageExtension: ~ code_coverage: format: