From c4e88ad4a0d80e0013d4c1fec6064b2933c371fc Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 2 Jan 2023 15:31:09 +0100 Subject: update to 2.0.0 raise dependency on PHP 8.1 --- composer.json | 117 ++++++++++++++++++++++++++------------------- php-ramsey-collection.spec | 78 ++++++++++++++---------------- 2 files changed, 103 insertions(+), 92 deletions(-) diff --git a/composer.json b/composer.json index 98862ee..5670901 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,8 @@ { "name": "ramsey/collection", - "type": "library", "description": "A PHP library for representing and manipulating collections.", + "license": "MIT", + "type": "library", "keywords": [ "array", "collection", @@ -10,7 +11,6 @@ "queue", "set" ], - "license": "MIT", "authors": [ { "name": "Ben Ramsey", @@ -19,31 +19,32 @@ } ], "require": { - "php": "^7.3 || ^8", - "symfony/polyfill-php81": "^1.23" + "php": "^8.1" }, "require-dev": { - "captainhook/captainhook": "^5.3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "ergebnis/composer-normalize": "^2.6", - "fakerphp/faker": "^1.5", - "hamcrest/hamcrest-php": "^2", - "jangregor/phpstan-prophecy": "^0.8", - "mockery/mockery": "^1.3", + "captainhook/plugin-composer": "^5.3", + "ergebnis/composer-normalize": "^2.28.3", + "fakerphp/faker": "^1.21", + "hamcrest/hamcrest-php": "^2.0", + "jangregor/phpstan-prophecy": "^1.0", + "mockery/mockery": "^1.5", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.3", + "phpcsstandards/phpcsutils": "^1.0.0-rc1", "phpspec/prophecy-phpunit": "^2.0", - "phpstan/extension-installer": "^1", - "phpstan/phpstan": "^0.12.32", - "phpstan/phpstan-mockery": "^0.12.5", - "phpstan/phpstan-phpunit": "^0.12.11", - "phpunit/phpunit": "^8.5 || ^9", - "psy/psysh": "^0.10.4", - "slevomat/coding-standard": "^6.3", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.4" - }, - "config": { - "sort-packages": true + "phpstan/extension-installer": "^1.2", + "phpstan/phpstan": "^1.9", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5", + "psalm/plugin-mockery": "^1.1", + "psalm/plugin-phpunit": "^0.18.4", + "ramsey/coding-standard": "^2.0.3", + "ramsey/conventional-commits": "^1.3", + "vimeo/psalm": "^5.4" }, + "minimum-stability": "RC", + "prefer-stable": true, "autoload": { "psr-4": { "Ramsey\\Collection\\": "src/" @@ -51,7 +52,6 @@ }, "autoload-dev": { "psr-4": { - "Ramsey\\Console\\": "resources/console/", "Ramsey\\Collection\\Test\\": "tests/", "Ramsey\\Test\\Generics\\": "tests/generics/" }, @@ -59,44 +59,61 @@ "vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php" ] }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true, + "ergebnis/composer-normalize": true, + "phpstan/extension-installer": true, + "captainhook/plugin-composer": true + }, + "sort-packages": true + }, + "extra": { + "captainhook": { + "force-install": true + }, + "ramsey/conventional-commits": { + "configFile": "conventional-commits.json" + } + }, "scripts": { - "post-autoload-dump": "captainhook install --ansi -f -s", "dev:analyze": [ "@dev:analyze:phpstan", "@dev:analyze:psalm" ], - "dev:analyze:phpstan": "phpstan --memory-limit=1G analyse", - "dev:analyze:psalm": "psalm --diff --config=psalm.xml", - "dev:build:clean": "git clean -fX build/.", - "dev:build:clear-cache": "git clean -fX build/cache/.", - "dev:lint": "phpcs --cache=build/cache/phpcs.cache", - "dev:lint:fix": "./bin/lint-fix.sh", - "dev:repl": [ - "echo ; echo 'Type ./bin/repl to start the REPL.'" + "dev:analyze:phpstan": "phpstan analyse --ansi --memory-limit=1G", + "dev:analyze:psalm": "psalm", + "dev:build:clean": "git clean -fX build/", + "dev:lint": [ + "@dev:lint:syntax", + "@dev:lint:style" ], - "dev:test": "phpunit", - "dev:test:all": [ + "dev:lint:fix": "phpcbf", + "dev:lint:style": "phpcs --colors", + "dev:lint:syntax": "parallel-lint --colors src/ tests/", + "dev:test": [ "@dev:lint", "@dev:analyze", - "@dev:test" + "@dev:test:unit" ], - "dev:test:coverage:ci": "phpunit --coverage-clover build/logs/clover.xml", - "dev:test:coverage:html": "phpunit --coverage-html build/coverage", - "test": "@dev:test:all" + "dev:test:coverage:ci": "phpunit --colors=always --coverage-text --coverage-clover build/coverage/clover.xml --coverage-cobertura build/coverage/cobertura.xml --coverage-crap4j build/coverage/crap4j.xml --coverage-xml build/coverage/coverage-xml --log-junit build/junit.xml", + "dev:test:coverage:html": "phpunit --colors=always --coverage-html build/coverage/coverage-html/", + "dev:test:unit": "phpunit --colors=always", + "test": "@dev:test" }, "scripts-descriptions": { - "dev:analyze": "Performs static analysis on the code base.", + "dev:analyze": "Runs all static analysis checks.", "dev:analyze:phpstan": "Runs the PHPStan static analyzer.", "dev:analyze:psalm": "Runs the Psalm static analyzer.", - "dev:build:clean": "Removes everything not under version control from the build directory.", - "dev:build:clear-cache": "Removes everything not under version control from build/cache/.", - "dev:lint": "Checks all source code for coding standards issues.", - "dev:lint:fix": "Checks source code for coding standards issues and fixes them, if possible.", - "dev:repl": "Note: Use ./bin/repl to run the REPL.", - "dev:test": "Runs the full unit test suite.", - "dev:test:all": "Runs linting, static analysis, and unit tests.", - "dev:test:coverage:ci": "Runs the unit test suite and generates a Clover coverage report.", - "dev:test:coverage:html": "Runs the unit tests suite and generates an HTML coverage report.", - "test": "Shortcut to run the full test suite." + "dev:build:clean": "Cleans the build/ directory.", + "dev:lint": "Runs all linting checks.", + "dev:lint:fix": "Auto-fixes coding standards issues, if possible.", + "dev:lint:style": "Checks for coding standards issues.", + "dev:lint:syntax": "Checks for syntax errors.", + "dev:test": "Runs linting, static analysis, and unit tests.", + "dev:test:coverage:ci": "Runs unit tests and generates CI coverage reports.", + "dev:test:coverage:html": "Runs unit tests and generates HTML coverage report.", + "dev:test:unit": "Runs unit tests.", + "test": "Runs linting, static analysis, and unit tests." } } diff --git a/php-ramsey-collection.spec b/php-ramsey-collection.spec index 2cff320..da032e8 100644 --- a/php-ramsey-collection.spec +++ b/php-ramsey-collection.spec @@ -10,7 +10,7 @@ %bcond_without tests # Github -%global gh_commit cccc74ee5e328031b15640b51056ee8d3bb66c0a +%global gh_commit a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner ramsey %global gh_project collection @@ -22,7 +22,7 @@ %global ns_project Collection Name: php-%{pk_vendor}-%{pk_name} -Version: 1.2.2 +Version: 2.0.0 Release: 1%{?dist} Summary: Library for representing and manipulating collections @@ -34,60 +34,53 @@ Source1: makesrc.sh BuildArch: noarch -BuildRequires: php(language) >= 7.3 +BuildRequires: php(language) >= 8.1 BuildRequires: php-date BuildRequires: php-spl # From composer.json, "require-dev": { -# "captainhook/captainhook": "^5.3", -# "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", -# "ergebnis/composer-normalize": "^2.6", -# "fakerphp/faker": "^1.5", -# "hamcrest/hamcrest-php": "^2", -# "jangregor/phpstan-prophecy": "^0.8",, -# "mockery/mockery": "^1.3", +# "captainhook/plugin-composer": "^5.3", +# "ergebnis/composer-normalize": "^2.28.3", +# "fakerphp/faker": "^1.21", +# "hamcrest/hamcrest-php": "^2.0", +# "jangregor/phpstan-prophecy": "^1.0", +# "mockery/mockery": "^1.5", +# "php-parallel-lint/php-console-highlighter": "^1.0", +# "php-parallel-lint/php-parallel-lint": "^1.3", +# "phpcsstandards/phpcsutils": "^1.0.0-rc1", # "phpspec/prophecy-phpunit": "^2.0", -# "phpstan/extension-installer": "^1", -# "phpstan/phpstan": "^0.12.32", -# "phpstan/phpstan-mockery": "^0.12.5", -# "phpstan/phpstan-phpunit": "^0.12.11", -# "phpunit/phpunit": "^8.5 || ^9", -# "psy/psysh": "^0.10.4", -# "slevomat/coding-standard": "^6.3", -# "squizlabs/php_codesniffer": "^3.5", -# "vimeo/psalm": "^4.4" +# "phpstan/extension-installer": "^1.2", +# "phpstan/phpstan": "^1.9", +# "phpstan/phpstan-mockery": "^1.1", +# "phpstan/phpstan-phpunit": "^1.3", +# "phpunit/phpunit": "^9.5", +# "psalm/plugin-mockery": "^1.1", +# "psalm/plugin-phpunit": "^0.18.4", +# "ramsey/coding-standard": "^2.0.3", +# "ramsey/conventional-commits": "^1.3", +# "vimeo/psalm": "^5.4" %if %{with tests} -BuildRequires: phpunit9 +BuildRequires: phpunit9 >= 9.5 %global phpunit %{_bindir}/phpunit9 # remirepo:1 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 -BuildRequires: (php-composer(symfony/polyfill-php81) >= 1.23 with php-composer(symfony/polyfill-php81) < 2) BuildRequires: (php-composer(fzaninotto/faker) >= 1.5 with php-composer(fzaninotto/faker) < 2) BuildRequires: (php-composer(hamcrest/hamcrest-php) >= 2 with php-composer(hamcrest/hamcrest-php) < 3) -BuildRequires: (php-composer(mockery/mockery) >= 1.3 with php-composer(mockery/mockery) < 2) +BuildRequires: (php-composer(mockery/mockery) >= 1.5 with php-composer(mockery/mockery) < 2) BuildRequires: (php-composer(phpspec/prophecy-phpunit) >= 2.0 with php-composer(phpspec/prophecy-phpunit) < 3) -# remirepo:7 +# remirepo:6 %else BuildRequires: php-Faker >= 1.5 BuildRequires: php-hamcrest2 >= 2 -BuildRequires: php-mockery >= 1.3 +BuildRequires: php-mockery >= 1.5 BuildRequires: php-phpspec-prophecy-phpunit >= 2.0 -BuildRequires: php-symfony-polyfill >= 1.23 %endif %endif # Autoloader BuildRequires: php-fedora-autoloader-devel # From composer.json, "require": { -# "php": "^7.3 || ^8", -# "symfony/polyfill-php81": "^1.23" -Requires: php(language) >= 7.3 -# remirepo:1 -%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 -Requires: (php-composer(symfony/polyfill-php81) >= 1.23 with php-composer(symfony/polyfill-php81) < 2) -# remirepo:3 -%else -Requires: php-symfony-polyfill >= 1.23 -%endif +# "php": "^8.1", +Requires: php(language) >= 8.1 # From phpcompatifo report for 1.1.1 Requires: php-spl @@ -115,12 +108,6 @@ phpab \ --template fedora \ --output src/autoload.php \ src -cat << 'EOF' | tee -a src/autoload.php - -\Fedora\Autoloader\Dependencies::required([ - '%{_datadir}/php/Symfony/Polyfill/autoload.php', -]); -EOF %install @@ -147,9 +134,12 @@ require '%{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}/autoload.php'; ]); EOF +: ignore PHPStan tests +find tests -type f -exec grep PHPStan {} \; -delete -print + : Run upstream test suite ret=0 -for cmdarg in "php %{phpunit}" php73 php74 php80 php81; do +for cmdarg in "php %{phpunit}" php81 php82; do if which $cmdarg; then set $cmdarg $1 ${2:- %{_bindir}/phpunit9} \ @@ -172,6 +162,10 @@ exit $ret %changelog +* Mon Jan 2 2023 Remi Collet - 2.0.0-1 +- update to 2.0.0 +- raise dependency on PHP 8.1 + * Mon Oct 11 2021 Remi Collet - 1.2.2-1 - update to 1.2.2 -- cgit