Skip to content

Fix PHP 8.4 and 8.5 deprecations - #32

Merged
TomK merged 1 commit into
masterfrom
php85-deprecations
Oct 22, 2026
Merged

TomK merged 1 commit into
masterfrom
php85-deprecations

Conversation

@TomK

@TomK TomK commented Oct 22, 2026

Copy link
Copy Markdown
Member

On PHP 8.5, rendering any form prints Deprecated: Using null as an array offset is deprecated (from Form.php lines 303 and 305) into the HTML, and loading Form or EnumDataHandler raises PHP 8.4's implicitly-nullable-parameter deprecation. FormTest::testRender already fails on master on PHP 8.5 for this reason; k4's billing, contacts, flags and notes use the package.

  • Rendering a form: no deprecation text in the output; markup unchanged.
  • Loading Form / EnumDataHandler: no deprecation.
  • Handler with no name: label and placeholder are '', 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::testCombined hits the EnumValidator deprecation that PR fixes, so this PR's 8.x jobs fail until then.

Test plan

🤖 Generated with Claude Code

- 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>
@TomK
TomK merged commit 8e0840b into master Oct 22, 2026
14 checks passed
@TomK
TomK deleted the php85-deprecations branch October 22, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant