Upgrade to PHP 8, PHPUnit 9, PHP_CodeSniffer 4, graze/standards 3#3
Merged
Merged
Conversation
Bump runtime and dev dependencies and migrate CI from Travis to GitHub Actions. Dependencies: - php: ^5.6|^7.0 -> ^7.4|^8.0 - respect/validation: ^1.1 -> ^2.2 - graze/standards: ^2.0 -> ^3.0 - phpunit/phpunit: ^5.7|^6|^7 -> ^9.0 - squizlabs/php_codesniffer: ^3.0 -> ^4.0 respect/validation 2.x port (AttributeSet extends its internal API): - assert()/check() now return void - appendRule() -> parent::addRule(); ->reference -> getReference() - add constructor (2.x AbstractComposite no longer routes variadic rules through addRule, which the AllOf/array handling relies on) - AttributeSetException: $defaultTemplates public static -> protected instance; chooseTemplate() now returns string PHPUnit 9: - replace @ExpectedException annotations with expectException() - fix assert()-returns-void assertions - update expected messages for 2.x formatter (backticks, grouped lines) - phpunit.xml.dist: <filter><whitelist> -> <coverage><include> Lint: fix abstract/visibility order for the PHPCS 4 sniff. CI: remove .travis.yml, add .github/workflows/ci.yml (lint + test matrix over PHP 7.4/8.0/8.1/8.2 x highest/lowest deps). Update Makefile matrix and README badge. Tests pass on both highest and prefer-lowest dependency sets. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add PHP 8.3, 8.4 and 8.5 to the test matrix. respect/validation stays at 2.2.4 (the last release supporting PHP 7.4); the workflow keeps the composer platform pinned per matrix job so this is exercised on each runtime. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…t/validation 2.2.x The composer platform stays pinned to 7.4 (composer.json), so highest resolves to 2.2.4 and lowest to 2.2.0 on every PHP runtime, rather than newer-PHP jobs pulling respect/validation 2.4.x. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrades the library to support PHP 8, PHPUnit 9, PHP_CodeSniffer 4, and graze/standards 3, and migrates CI from Travis to GitHub Actions.
Dependency changes
php^5.6 | ^7.0^7.4 | ^8.0respect/validation^1.1^2.2graze/standards^2.0^3.0phpunit/phpunit^5.7 | ^6 | ^7^9.0squizlabs/php_codesniffer^3.0^4.0respect/validation 2.x port
AttributeSet/AttributeSetExceptionextend respect/validation's internal API, which changed substantially in 2.x:assert()/check()now returnvoidappendRule()removed →parent::addRule();$rule->reference→$rule->getReference()AbstractCompositeno longer routes variadic rules throughaddRule(), which the AllOf-unwrapping and nested-array handling depend onAttributeSetException::$defaultTemplateschanged frompublic statictoprotected(instance);chooseTemplate()now returnsstringPHPUnit 9
@expectedException/@expectedExceptionMessageannotations withexpectException()/expectExceptionMessage()voidassert()phpunit.xml.dist:<filter><whitelist>→<coverage><include>Lint
abstract/visibility ordering flagged by a new PHPCS 4 sniffCI
.travis.yml.github/workflows/ci.yml: a lint job + a test matrix over PHP 7.4 / 8.0 / 8.1 / 8.2 × highest / lowest dependency setsMakefiletest matrix and the README build badgeVerification
Run locally (PHP 8.5, Composer 2.9):
OK (50 tests, 91 assertions)on both highest (respect/validation 2.2.4) and--prefer-lowest(2.2.0)phpcsclean against graze/standards 3 / PHPCS 4🤖 Generated with Claude Code