Repository navigation
Fix PHP 8.4 and 8.5 deprecations - #32
Merged
Merged
Conversation
- Form::setHandlerDecorator() and EnumDataHandler::__construct() had implicitly nullable parameters, deprecated in PHP 8.4 and raised when the classes are compiled. - Form::getHandlerDecorator() used a null field name as an array key, deprecated in PHP 8.5; rendering a form printed the notice into the HTML. A null name is read as '', as PHP did before. - getLabel() and getPlaceholder() passed a null handler name to Strings::splitOnCamelCase(); it is now cast to string. phpunit converts deprecations to exceptions, and the unit tests run on PHP 7.3, 7.4 and 8.2-8.5. CircleCI is removed. Co-Authored-By: Claude Opus 5.5 <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.
On PHP 8.5, rendering any form prints
Deprecated: Using null as an array offset is deprecated(fromForm.phplines 303 and 305) into the HTML, and loadingFormorEnumDataHandlerraises PHP 8.4's implicitly-nullable-parameter deprecation.FormTest::testRenderalready fails on master on PHP 8.5 for this reason; k4's billing, contacts, flags and notes use the package.Form/EnumDataHandler: no deprecation.'', as before, with no deprecation.Unit tests now run on PHP 7.3, 7.4 and 8.2–8.5 with deprecations converted to exceptions; CircleCI is removed.
Needs packaged/validate#11 released first —
EnumDataHandlerTest::testCombinedhits theEnumValidatordeprecation that PR fixes, so this PR's 8.x jobs fail until then.Test plan
FormTest::testRender(1 failure); with deprecations converted, this branch errored only on theEnumValidatorcase.EnumValidatorin place, all 32 tests pass on PHP 7.4, 8.2 and 8.5.🤖 Generated with Claude Code