diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7a95124..524af2d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,12 +34,13 @@ jobs: COMPOSER_CACHE_KEY: 'composer-7.2' with: path: vendor - key: ${{ env.COMPOSER_CACHE_KEY }} + key: ${{ env.COMPOSER_CACHE_KEY }}-${{ hashFiles('composer.json') }} restore-keys: ${{ env.COMPOSER_CACHE_KEY }} - name: Install dependencies - if: steps.composer-cache.outputs.cache-hit != 'true' - run: composer install --prefer-dist --no-progress --no-suggest + run: | + /opt/spaceonfire/bin/select-composer.sh v2 + composer install --prefer-dist --no-progress - name: Check coding standard run: vendor/bin/ecs check --no-progress-bar --no-interaction @@ -58,12 +59,13 @@ jobs: COMPOSER_CACHE_KEY: 'composer-7.2' with: path: vendor - key: ${{ env.COMPOSER_CACHE_KEY }} + key: ${{ env.COMPOSER_CACHE_KEY }}-${{ hashFiles('composer.json') }} restore-keys: ${{ env.COMPOSER_CACHE_KEY }} - name: Install dependencies - if: steps.composer-cache.outputs.cache-hit != 'true' - run: composer install --prefer-dist --no-progress --no-suggest + run: | + /opt/spaceonfire/bin/select-composer.sh v2 + composer install --prefer-dist --no-progress - name: PHPStan run: vendor/bin/phpstan analyse --no-progress --no-interaction @@ -76,6 +78,7 @@ jobs: - '7.2' - '7.3' - '7.4' + - '8.0' container: spaceonfire/nginx-php-fpm:latest-${{ matrix.php-version }} steps: - name: Checkout @@ -88,18 +91,19 @@ jobs: COMPOSER_CACHE_KEY: 'composer-${{ matrix.php-version }}' with: path: vendor - key: ${{ env.COMPOSER_CACHE_KEY }} + key: ${{ env.COMPOSER_CACHE_KEY }}-${{ hashFiles('composer.json') }} restore-keys: ${{ env.COMPOSER_CACHE_KEY }} - name: Install dependencies - if: steps.composer-cache.outputs.cache-hit != 'true' - run: composer install --prefer-dist --no-progress --no-suggest + run: | + /opt/spaceonfire/bin/select-composer.sh v2 + composer install --prefer-dist --no-progress - name: PHPUnit run: | apk update docker-php-ext-enable xdebug - vendor/bin/phpunit --no-interaction + php -d xdebug.mode=coverage vendor/bin/phpunit --no-interaction cat build/coverage.txt - name: PHPUnit Artifacts diff --git a/CHANGELOG.md b/CHANGELOG.md index 364e3d5..63683eb 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,8 +22,16 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip - Nothing --> +## [1.3.1] - 2021-02-16 + +### Added + +- Support installation on PHP 8 + ## [1.3.0] - 2020-10-17 + ### Added + - Lot of improvements for `DisjunctionType` and `ConjunctionType`: - General code moved to `AbstractAggregatedType` class; - They can be iterated over now; @@ -34,31 +42,44 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip - General code moved to `AbstractAggregatedTypeFactory` class; - They can now parse complex type strings, such as: `int|string|array|string|null`. - `GroupTypeFactory` allows parsing grouped with `()` type strings like: `(string|int)[]` -- `MemoizedTypeFactory` allows cache results of calls to `supports()` and `make()`. - Recommend wrap type factory with memoized decorator in production. +- `MemoizedTypeFactory` allows cache results of calls to `supports()` and `make()`. Recommend wrap type factory with + memoized decorator in production. + ### Fixed + - Fixed string representation of collection type with complex value type. ## [1.2.0] - 2020-10-13 + ### Removed + - `Type` interface doesn't declare static methods `support()` and `create()` no more. + ### Added + - Dynamic type factories. It replaces static methods in `Type` classes and static `TypeFactory` class. - Mixed type. - Void type. + ### Deprecated -- Static methods in classes implementing `Type` interface and static `TypeFactory` class marked as deprecated. - Their API still backward compatible using dynamic type factories. It will be removed in next major release. + +- Static methods in classes implementing `Type` interface and static `TypeFactory` class marked as deprecated. Their API + still backward compatible using dynamic type factories. It will be removed in next major release. ## [1.1.0] - 2020-10-04 + ### Added + - Support non strict mode for all scalar types (int, float, string and bool) - Force return `null` when casting to null builtin type ## [1.0.1] - 2020-09-26 + ### Fixed + - Development config updates - Minor type issues fixes found by static analyser ## [1.0.0] - 2020-06-01 + - First release diff --git a/composer.json b/composer.json index b33c72e..85bb141 100755 --- a/composer.json +++ b/composer.json @@ -17,16 +17,17 @@ } ], "require": { - "php": "^7.2", + "php": "^7.2|^8.0", "webmozart/assert": "^1.3" }, "require-dev": { "ext-json": "*", "phpstan/phpstan": "^0.12", "phpstan/phpstan-webmozart-assert": "^0.12", - "phpunit/phpunit": "^8.0", + "phpunit/phpunit": "^8.5|^9.5", + "phpspec/prophecy-phpunit": "^1.1|^2.0", "roave/security-advisories": "dev-master", - "symplify/easy-coding-standard-prefixed": "^8.3" + "symplify/easy-coding-standard-prefixed": "^8.3|^9.1" }, "autoload": { "psr-4": { @@ -39,7 +40,7 @@ } }, "scripts": { - "test": "phpunit", + "test": "@php -d xdebug.mode=coverage `which phpunit`", "codestyle": "ecs check --ansi", "lint": "phpstan analyze --memory-limit=512M --ansi" }, diff --git a/src/TypeFactory.php b/src/TypeFactory.php index f42b1a9..c9397e9 100755 --- a/src/TypeFactory.php +++ b/src/TypeFactory.php @@ -8,7 +8,6 @@ /** * Class TypeFactory - * @package spaceonfire\Type * @deprecated use dynamic type factory instead. This class will be removed in next major release. * @see Factory\TypeFactoryInterface */ diff --git a/tests/AbstractTestCase.php b/tests/AbstractTestCase.php new file mode 100644 index 0000000..2b0e2b9 --- /dev/null +++ b/tests/AbstractTestCase.php @@ -0,0 +1,18 @@ +