diff --git a/.travis.yml b/.travis.yml index 5f5a5b93..955c7fd7 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,10 +16,6 @@ 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 @@ -28,10 +23,10 @@ matrix: - php: 7.1 env: 'COMPOSER_FLAGS="--prefer-lowest --prefer-stable"' -# branches: -# only: -# - master - +branches: + only: + - master + - 1.x before_script: - composer update --prefer-source $COMPOSER_FLAGS 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/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 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..57c9acfd 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,20 +25,21 @@ "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" }, "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: