diff --git a/.github/workflows/test-unit-cov.yml b/.github/workflows/test-unit-cov.yml index 3c45bac..819d420 100644 --- a/.github/workflows/test-unit-cov.yml +++ b/.github/workflows/test-unit-cov.yml @@ -21,7 +21,7 @@ jobs: with: path: | vendor - key: vendor-${{ hashFiles('composer.lock') }} + key: deps-${{ hashFiles('composer.lock') }} - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -32,7 +32,7 @@ jobs: tools: composer - name: Populate vendor - run: '[ -e vendor ] || composer install' + run: '[ -e vendor ] || (composer install && patch -s -p0 < ./tests/phpunit.patch)' - name: Run Tests With Coverage run: make deps test-coverage && bash <(curl -s https://codecov.io/bash) \ No newline at end of file diff --git a/.github/workflows/test-unit.yml b/.github/workflows/test-unit.yml index 385755e..02ba09e 100644 --- a/.github/workflows/test-unit.yml +++ b/.github/workflows/test-unit.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: operating-system: [ 'ubuntu-latest' ] - php-versions: [ '5.6', '7.0', '7.1', '7.2', '7.3', '8.0' ] + php-versions: [ '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '8.0', '8.1' ] steps: - name: Checkout uses: actions/checkout@v2 @@ -21,7 +21,7 @@ jobs: with: path: | vendor - key: vendor-${{ hashFiles('composer.lock') }} + key: deps-${{ hashFiles('composer.lock') }} - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -31,7 +31,7 @@ jobs: tools: composer - name: Populate vendor - run: '[ -e vendor ] || composer install' + run: '[ -e vendor ] || (composer install && patch -s -p0 < ./tests/phpunit.patch)' - name: Run Tests run: make deps test \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 9093053..02a42b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.12.38] - 2021-09-17 + +### Fixed +- PHP 8.1 Deprecation notices with missing returns. + ## [0.12.37] - 2021-08-29 ### Added @@ -101,6 +106,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Export `null` value instead of skipping it for properties having `null` type. +[0.12.38]: https://github.com/swaggest/php-json-schema/compare/v0.12.37...v0.12.38 [0.12.37]: https://github.com/swaggest/php-json-schema/compare/v0.12.36...v0.12.37 [0.12.36]: https://github.com/swaggest/php-json-schema/compare/v0.12.35...v0.12.36 [0.12.35]: https://github.com/swaggest/php-json-schema/compare/v0.12.34...v0.12.35 diff --git a/Makefile b/Makefile index fdd7bc0..4be25e1 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,13 @@ docker-lint: @docker run -v $$PWD:/app --rm phpstan/phpstan analyze -l 7 -c phpstan.neon ./src test: - @php -derror_reporting="E_ALL & ~E_DEPRECATED" vendor/bin/phpunit --configuration phpunit.xml + @php vendor/bin/phpunit --configuration phpunit.xml + +docker-test-new: + @docker run -v $$PWD:/app -w /app --rm php:8.1.0RC1-zts-buster php vendor/bin/phpunit --configuration phpunit.xml + +docker-test-old: + @docker run -v $$PWD:/app -w /app --rm php:5.4-cli php vendor/bin/phpunit --configuration phpunit.xml test-coverage: @php -derror_reporting="E_ALL & ~E_DEPRECATED" -dzend_extension=xdebug.so -dxdebug.mode=coverage vendor/bin/phpunit --configuration phpunit.xml --coverage-text --coverage-clover=coverage.xml diff --git a/composer.json b/composer.json index cc9708d..be0357d 100644 --- a/composer.json +++ b/composer.json @@ -7,11 +7,10 @@ "ext-json": "*", "ext-mbstring": "*", "phplang/scope-exit": "^1.0", - "swaggest/json-diff": "^3.5.1" + "swaggest/json-diff": "^3.8.2" }, "require-dev": { - "phpunit/phpunit": "^5", - "phpunit/php-code-coverage": "^4" + "phpunit/phpunit": "^4.8.23" }, "license": "MIT", "authors": [ @@ -36,7 +35,7 @@ }, "config": { "platform": { - "php": "5.6.0" + "php": "5.4.45" } } } diff --git a/composer.lock b/composer.lock index a4fd601..a197784 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f0ff2afe7ca18fda8104ff02b06a8d98", + "content-hash": "9f4522b4baf6a56fb734cf558f65af8f", "packages": [ { "name": "phplang/scope-exit", @@ -56,16 +56,16 @@ }, { "name": "swaggest/json-diff", - "version": "v3.8.1", + "version": "v3.8.2", "source": { "type": "git", "url": "https://github.com/swaggest/json-diff.git", - "reference": "d2184358c5ef5ecaa1f6b4c2bce175fac2d25670" + "reference": "d223be0ee90cd6001c21af39573fbc2f600a0bbe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swaggest/json-diff/zipball/d2184358c5ef5ecaa1f6b4c2bce175fac2d25670", - "reference": "d2184358c5ef5ecaa1f6b4c2bce175fac2d25670", + "url": "https://api.github.com/repos/swaggest/json-diff/zipball/d223be0ee90cd6001c21af39573fbc2f600a0bbe", + "reference": "d223be0ee90cd6001c21af39573fbc2f600a0bbe", "shasum": "" }, "require": { @@ -93,9 +93,9 @@ "description": "JSON diff/rearrange/patch/pointer library for PHP", "support": { "issues": "https://github.com/swaggest/json-diff/issues", - "source": "https://github.com/swaggest/json-diff/tree/v3.8.1" + "source": "https://github.com/swaggest/json-diff/tree/v3.8.2" }, - "time": "2020-09-25T17:47:07+00:00" + "time": "2021-09-17T13:39:44+00:00" } ], "packages-dev": [ @@ -157,193 +157,39 @@ }, "time": "2015-06-14T21:17:01+00:00" }, - { - "name": "myclabs/deep-copy", - "version": "1.7.0", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^4.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.x" - }, - "time": "2017-10-19T19:58:43+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "shasum": "" - }, - "require": { - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "^4.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/master" - }, - "time": "2017-09-11T18:02:19+00:00" - }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.3.2", + "version": "2.0.5", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2" + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2", - "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0", - "phpdocumentor/reflection-common": "^1.0.0", - "phpdocumentor/type-resolver": "^0.4.0", - "webmozart/assert": "^1.0" + "php": ">=5.3.3" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.4" + "phpunit/phpunit": "~4.0" }, - "type": "library", - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/release/3.x" - }, - "time": "2017-11-10T14:09:06+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "0.4.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", - "shasum": "" - }, - "require": { - "php": "^5.5 || ^7.0", - "phpdocumentor/reflection-common": "^1.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ + "psr-0": { + "phpDocumentor": [ "src/" ] } @@ -355,14 +201,14 @@ "authors": [ { "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "email": "mike.vanriel@naenius.com" } ], "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/master" + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/release/2.x" }, - "time": "2017-07-14T14:27:02+00:00" + "time": "2016-01-25T08:17:30+00:00" }, { "name": "phpspec/prophecy", @@ -433,40 +279,39 @@ }, { "name": "phpunit/php-code-coverage", - "version": "4.0.8", + "version": "2.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": "^5.6 || ^7.0", - "phpunit/php-file-iterator": "^1.3", - "phpunit/php-text-template": "^1.2", - "phpunit/php-token-stream": "^1.4.2 || ^2.0", - "sebastian/code-unit-reverse-lookup": "^1.0", - "sebastian/environment": "^1.3.2 || ^2.0", - "sebastian/version": "^1.0 || ^2.0" + "php": ">=5.3.3", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.2", + "phpunit/php-token-stream": "~1.3", + "sebastian/environment": "^1.3.2", + "sebastian/version": "~1.0" }, "require-dev": { - "ext-xdebug": "^2.1.4", - "phpunit/phpunit": "^5.7" + "ext-xdebug": ">=2.1.4", + "phpunit/phpunit": "~4" }, "suggest": { - "ext-xdebug": "^2.5.1" + "ext-dom": "*", + "ext-xdebug": ">=2.2.1", + "ext-xmlwriter": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-master": "2.2.x-dev" } }, "autoload": { @@ -495,9 +340,9 @@ "support": { "irc": "irc://irc.freenode.net/phpunit", "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/4.0" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/2.2" }, - "time": "2017-04-02T07:44:40+00:00" + "time": "2015-10-06T15:47:00+00:00" }, { "name": "phpunit/php-file-iterator", @@ -705,50 +550,40 @@ }, { "name": "phpunit/phpunit", - "version": "5.7.27", + "version": "4.8.36", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", "shasum": "" }, "require": { "ext-dom": "*", "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "myclabs/deep-copy": "~1.3", - "php": "^5.6 || ^7.0", - "phpspec/prophecy": "^1.6.2", - "phpunit/php-code-coverage": "^4.0.4", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpspec/prophecy": "^1.3.1", + "phpunit/php-code-coverage": "~2.1", "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^3.2", - "sebastian/comparator": "^1.2.4", - "sebastian/diff": "^1.4.3", - "sebastian/environment": "^1.3.4 || ^2.0", - "sebastian/exporter": "~2.0", - "sebastian/global-state": "^1.1", - "sebastian/object-enumerator": "~2.0", - "sebastian/resource-operations": "~1.0", - "sebastian/version": "^1.0.6|^2.0.1", - "symfony/yaml": "~2.1|~3.0|~4.0" - }, - "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2" - }, - "require-dev": { - "ext-pdo": "*" + "phpunit/phpunit-mock-objects": "~2.3", + "sebastian/comparator": "~1.2.2", + "sebastian/diff": "~1.2", + "sebastian/environment": "~1.3", + "sebastian/exporter": "~1.2", + "sebastian/global-state": "~1.0", + "sebastian/version": "~1.0", + "symfony/yaml": "~2.1|~3.0" }, "suggest": { - "ext-xdebug": "*", "phpunit/php-invoker": "~1.1" }, "bin": [ @@ -757,7 +592,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.7.x-dev" + "dev-master": "4.8.x-dev" } }, "autoload": { @@ -785,35 +620,32 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/5.7.27" + "source": "https://github.com/sebastianbergmann/phpunit/tree/4.8.36" }, - "time": "2018-02-01T05:50:59+00:00" + "time": "2017-06-21T08:07:12+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "3.4.4", + "version": "2.3.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", - "php": "^5.6 || ^7.0", - "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^1.2 || ^2.0" - }, - "conflict": { - "phpunit/phpunit": "<5.4.0" + "php": ">=5.3.3", + "phpunit/php-text-template": "~1.2", + "sebastian/exporter": "~1.2" }, "require-dev": { - "phpunit/phpunit": "^5.4" + "phpunit/phpunit": "~4.4" }, "suggest": { "ext-soap": "*" @@ -821,7 +653,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2.x-dev" + "dev-master": "2.3.x-dev" } }, "autoload": { @@ -849,65 +681,10 @@ "support": { "irc": "irc://irc.freenode.net/phpunit", "issues": "https://github.com/sebastianbergmann/phpunit-mock-objects/issues", - "source": "https://github.com/sebastianbergmann/phpunit-mock-objects/tree/3.4" + "source": "https://github.com/sebastianbergmann/phpunit-mock-objects/tree/2.3" }, "abandoned": true, - "time": "2017-06-30T09:13:00+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T08:15:22+00:00" + "time": "2015-10-02T06:51:40+00:00" }, { "name": "sebastian/comparator", @@ -1035,28 +812,28 @@ }, { "name": "sebastian/environment", - "version": "2.0.0", + "version": "1.3.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^5.0" + "phpunit/phpunit": "^4.8 || ^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -1083,27 +860,27 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/master" + "source": "https://github.com/sebastianbergmann/environment/tree/1.3" }, - "time": "2016-11-26T07:53:53+00:00" + "time": "2016-08-18T05:49:44+00:00" }, { "name": "sebastian/exporter", - "version": "2.0.0", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", "shasum": "" }, "require": { "php": ">=5.3.3", - "sebastian/recursion-context": "~2.0" + "sebastian/recursion-context": "~1.0" }, "require-dev": { "ext-mbstring": "*", @@ -1112,7 +889,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -1156,7 +933,7 @@ "issues": "https://github.com/sebastianbergmann/exporter/issues", "source": "https://github.com/sebastianbergmann/exporter/tree/master" }, - "time": "2016-11-19T08:54:04+00:00" + "time": "2016-06-17T09:04:28+00:00" }, { "name": "sebastian/global-state", @@ -1213,68 +990,18 @@ }, "time": "2015-10-12T03:26:01+00:00" }, - { - "name": "sebastian/object-enumerator", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", - "shasum": "" - }, - "require": { - "php": ">=5.6", - "sebastian/recursion-context": "~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/master" - }, - "time": "2017-02-18T15:18:39+00:00" - }, { "name": "sebastian/recursion-context", - "version": "2.0.0", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", "shasum": "" }, "require": { @@ -1286,7 +1013,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { @@ -1318,77 +1045,23 @@ "issues": "https://github.com/sebastianbergmann/recursion-context/issues", "source": "https://github.com/sebastianbergmann/recursion-context/tree/master" }, - "time": "2016-11-19T07:33:16+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "shasum": "" - }, - "require": { - "php": ">=5.6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/master" - }, - "time": "2015-07-28T20:34:47+00:00" + "time": "2016-10-03T07:41:43+00:00" }, { "name": "sebastian/version", - "version": "2.0.1", + "version": "1.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", "shasum": "" }, - "require": { - "php": ">=5.6" - }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, "autoload": { "classmap": [ "src/" @@ -1409,9 +1082,9 @@ "homepage": "https://github.com/sebastianbergmann/version", "support": { "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/master" + "source": "https://github.com/sebastianbergmann/version/tree/1.0.6" }, - "time": "2016-10-03T07:35:21+00:00" + "time": "2015-06-21T13:59:46+00:00" }, { "name": "symfony/polyfill-ctype", @@ -1494,32 +1167,28 @@ }, { "name": "symfony/yaml", - "version": "v3.4.47", + "version": "v2.8.52", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "88289caa3c166321883f67fe5130188ebbb47094" + "reference": "02c1859112aa779d9ab394ae4f3381911d84052b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/88289caa3c166321883f67fe5130188ebbb47094", - "reference": "88289caa3c166321883f67fe5130188ebbb47094", + "url": "https://api.github.com/repos/symfony/yaml/zipball/02c1859112aa779d9ab394ae4f3381911d84052b", + "reference": "02c1859112aa779d9ab394ae4f3381911d84052b", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", + "php": ">=5.3.9", "symfony/polyfill-ctype": "~1.8" }, - "conflict": { - "symfony/console": "<3.4" - }, - "require-dev": { - "symfony/console": "~3.4|~4.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, "autoload": { "psr-4": { "Symfony\\Component\\Yaml\\": "" @@ -1545,76 +1214,9 @@ "description": "Symfony Yaml Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v3.4.47" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-24T10:57:07+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.9.1", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0 || ^8.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<3.9.1" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" - }, - "type": "library", - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.9.1" + "source": "https://github.com/symfony/yaml/tree/v2.8.52" }, - "time": "2020-07-08T17:02:28+00:00" + "time": "2018-11-11T11:18:13+00:00" } ], "aliases": [], @@ -1629,7 +1231,7 @@ }, "platform-dev": [], "platform-overrides": { - "php": "5.6.0" + "php": "5.4.45" }, - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.1.0" } diff --git a/src/Constraint/Properties.php b/src/Constraint/Properties.php index a99db73..f0d393f 100644 --- a/src/Constraint/Properties.php +++ b/src/Constraint/Properties.php @@ -164,6 +164,7 @@ public function isEmpty() return (count($this->__arrayOfData) + count($this->nestedProperties)) === 0; } + #[\ReturnTypeWillChange] public function jsonSerialize() { $result = $this->toArray(); diff --git a/src/MagicMapTrait.php b/src/MagicMapTrait.php index d2bec75..d6a433f 100644 --- a/src/MagicMapTrait.php +++ b/src/MagicMapTrait.php @@ -27,11 +27,13 @@ public function &__get($name) } } + #[\ReturnTypeWillChange] public function offsetExists($offset) { return array_key_exists($offset, $this->__arrayOfData); } + #[\ReturnTypeWillChange] public function &offsetGet($offset) { if (isset($this->__arrayOfData[$offset])) { @@ -42,11 +44,13 @@ public function &offsetGet($offset) } } + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { $this->__set($offset, $value); } + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->__arrayOfData[$offset]); @@ -57,6 +61,7 @@ public function &toArray() return $this->__arrayOfData; } + #[\ReturnTypeWillChange] public function jsonSerialize() { return (object)$this->__arrayOfData; @@ -65,12 +70,14 @@ public function jsonSerialize() /** @var \ArrayIterator */ private $iterator; + /** * Return the current element * @link http://php.net/manual/en/iterator.current.php * @return mixed Can return any type. * @since 5.0.0 */ + #[\ReturnTypeWillChange] public function current() { return $this->iterator->current(); @@ -82,6 +89,7 @@ public function current() * @return void Any returned value is ignored. * @since 5.0.0 */ + #[\ReturnTypeWillChange] public function next() { $this->iterator->next(); @@ -93,6 +101,7 @@ public function next() * @return mixed scalar on success, or null on failure. * @since 5.0.0 */ + #[\ReturnTypeWillChange] public function key() { return $this->iterator->key(); @@ -105,6 +114,7 @@ public function key() * Returns true on success or false on failure. * @since 5.0.0 */ + #[\ReturnTypeWillChange] public function valid() { return $this->iterator->valid(); @@ -116,6 +126,7 @@ public function valid() * @return void Any returned value is ignored. * @since 5.0.0 */ + #[\ReturnTypeWillChange] public function rewind() { $this->iterator = new \ArrayIterator($this->__arrayOfData); diff --git a/src/Structure/ClassStructureTrait.php b/src/Structure/ClassStructureTrait.php index 99ea814..f9a4ca3 100644 --- a/src/Structure/ClassStructureTrait.php +++ b/src/Structure/ClassStructureTrait.php @@ -95,6 +95,7 @@ public static function create() /** * @return \stdClass */ + #[\ReturnTypeWillChange] public function jsonSerialize() { $result = new \stdClass(); diff --git a/src/Structure/ObjectItemTrait.php b/src/Structure/ObjectItemTrait.php index 63e9dac..54ec030 100644 --- a/src/Structure/ObjectItemTrait.php +++ b/src/Structure/ObjectItemTrait.php @@ -103,6 +103,7 @@ public function getPatternPropertyNames($pattern) return null; } + #[\ReturnTypeWillChange] public function jsonSerialize() { if ($this->__nestedObjects) { diff --git a/src/Wrapper.php b/src/Wrapper.php index 83f6632..98946f6 100644 --- a/src/Wrapper.php +++ b/src/Wrapper.php @@ -214,6 +214,7 @@ public function exportSchema() return clone $this->schema; } + #[\ReturnTypeWillChange] public function jsonSerialize() { return $this->schema->jsonSerialize(); diff --git a/tests/phpunit.patch b/tests/phpunit.patch new file mode 100644 index 0000000..5f44950 --- /dev/null +++ b/tests/phpunit.patch @@ -0,0 +1,167 @@ +diff -ruN ./vendor/phpunit/phpunit/src/Framework/Constraint.php ./vendor/phpunit/phpunit/src/Framework/Constraint.php +--- ./vendor/phpunit/phpunit/src/Framework/Constraint.php 2017-06-21 10:07:12.000000000 +0200 ++++ ./vendor/phpunit/phpunit/src/Framework/Constraint.php 2021-09-17 15:09:21.000000000 +0200 +@@ -81,6 +81,7 @@ + * + * @since Method available since Release 3.4.0 + */ ++ #[\ReturnTypeWillChange] + public function count() + { + return 1; +diff -ruN ./vendor/phpunit/phpunit/src/Util/Configuration.php ./vendor/phpunit/phpunit/src/Util/Configuration.php +--- ./vendor/phpunit/phpunit/src/Util/Configuration.php 2017-06-21 10:07:12.000000000 +0200 ++++ ./vendor/phpunit/phpunit/src/Util/Configuration.php 2021-09-17 14:46:32.000000000 +0200 +@@ -162,7 +162,7 @@ + /** + * @since Method available since Release 3.4.0 + */ +- final private function __clone() ++ private function __clone() + { + } + +@@ -516,7 +516,7 @@ + // See https://github.com/sebastianbergmann/phpunit/issues/277 + switch ($array) { + case 'var': +- $target = &$GLOBALS; ++// $target = &$GLOBALS; + break; + + case 'server': +diff -ruN ./vendor/phpunit/phpunit/src/Util/Getopt.php ./vendor/phpunit/phpunit/src/Util/Getopt.php +--- ./vendor/phpunit/phpunit/src/Util/Getopt.php 2017-06-21 10:07:12.000000000 +0200 ++++ ./vendor/phpunit/phpunit/src/Util/Getopt.php 2021-09-17 15:04:26.000000000 +0200 +@@ -21,7 +21,7 @@ + return array(array(), array()); + } + +- $opts = array(); ++ $opts = array(); + $non_opts = array(); + + if ($long_options) { +@@ -35,7 +35,10 @@ + reset($args); + array_map('trim', $args); + +- while (list($i, $arg) = each($args)) { ++ ++ for ($i = 0; $i < count($args); $i++) { ++ $arg = $args[$i]; ++ + if ($arg == '') { + continue; + } +@@ -45,24 +48,30 @@ + break; + } + ++ $nextArg = isset($args[$i]) ? $args[$i] : null; ++ + if ($arg[0] != '-' || + (strlen($arg) > 1 && $arg[1] == '-' && !$long_options)) { + $non_opts[] = $args[$i]; + continue; + } elseif (strlen($arg) > 1 && $arg[1] == '-') { +- self::parseLongOption( ++ if (self::parseLongOption( + substr($arg, 2), + $long_options, + $opts, +- $args +- ); ++ $nextArg ++ )) { ++ $i++; ++ } + } else { +- self::parseShortOption( ++ if (self::parseShortOption( + substr($arg, 1), + $short_options, + $opts, +- $args +- ); ++ $nextArg ++ )) { ++ $i++; ++ } + } + } + +@@ -74,7 +83,7 @@ + $argLen = strlen($arg); + + for ($i = 0; $i < $argLen; $i++) { +- $opt = $arg[$i]; ++ $opt = $arg[$i]; + $opt_arg = null; + + if (($spec = strstr($short_options, $opt)) === false || +@@ -107,11 +116,11 @@ + } + } + +- protected static function parseLongOption($arg, $long_options, &$opts, &$args) ++ protected static function parseLongOption($arg, $long_options, &$opts, $nextArg) + { +- $count = count($long_options); +- $list = explode('=', $arg); +- $opt = $list[0]; ++ $count = count($long_options); ++ $list = explode('=', $arg); ++ $opt = $list[0]; + $opt_arg = null; + + if (count($list) > 1) { +@@ -121,7 +130,7 @@ + $opt_len = strlen($opt); + + for ($i = 0; $i < $count; $i++) { +- $long_opt = $long_options[$i]; ++ $long_opt = $long_options[$i]; + $opt_start = substr($long_opt, 0, $opt_len); + + if ($opt_start != $opt) { +@@ -131,20 +140,24 @@ + $opt_rest = substr($long_opt, $opt_len); + + if ($opt_rest != '' && $opt[0] != '=' && $i + 1 < $count && +- $opt == substr($long_options[$i+1], 0, $opt_len)) { ++ $opt == substr($long_options[$i + 1], 0, $opt_len)) { + throw new PHPUnit_Framework_Exception( + "option --$opt is ambiguous" + ); + } + ++ $ret = false; ++ + if (substr($long_opt, -1) == '=') { + if (substr($long_opt, -2) != '==') { +- if (!strlen($opt_arg) && +- !(list(, $opt_arg) = each($args))) { ++ if (empty($opt_arg) && ++ empty($nextArg) /*false*/) { + throw new PHPUnit_Framework_Exception( + "option --$opt requires an argument" + ); + } ++ ++ $ret = true; + } + } elseif ($opt_arg) { + throw new PHPUnit_Framework_Exception( +@@ -153,9 +166,9 @@ + } + + $full_option = '--' . preg_replace('/={1,2}$/', '', $long_opt); +- $opts[] = array($full_option, $opt_arg); ++ $opts[] = array($full_option, $opt_arg); + +- return; ++ return $ret; + } + + throw new PHPUnit_Framework_Exception("unrecognized option --$opt"); diff --git a/tests/src/PHPUnit/ClassStructure/ClassStructureTest.php b/tests/src/PHPUnit/ClassStructure/ClassStructureTest.php index d3f37ca..a00f90d 100644 --- a/tests/src/PHPUnit/ClassStructure/ClassStructureTest.php +++ b/tests/src/PHPUnit/ClassStructure/ClassStructureTest.php @@ -33,6 +33,9 @@ public function testSample() $this->assertSame('11', $object->recursion->propOne); $this->assertSame(22, $object->recursion->propTwo); + $this->assertSame('11', $object['recursion']['propOne']); + $this->assertNull( $object['nonexistent']); + $exported = $schema->out($object); $this->assertSame('{"propOne":"1","propTwo":2,"recursion":{"propOne":"11","propTwo":22}}', json_encode($exported)); } diff --git a/tests/src/PHPUnit/Spec/SchemaTestSuite.php b/tests/src/PHPUnit/Spec/SchemaTestSuite.php index 6a3d36a..3ad05d6 100644 --- a/tests/src/PHPUnit/Spec/SchemaTestSuite.php +++ b/tests/src/PHPUnit/Spec/SchemaTestSuite.php @@ -67,7 +67,7 @@ protected function provider($path) } */ - $name = $entry . ' ' . $test->description . ': ' . $case->description . ' [' . $c . ']'; + $name = $entry . ' ' . (isset($test->description) ? $test->description : '') . ': ' . (isset($case->description) ? $case->description : '') . ' [' . $c . ']'; if (!isset($test->schema)) { if (isset($test->schemas)) { foreach ($test->schemas as $i => $schema) {