Skip to content

Compatibility: preserve key subclass contracts and operator names - #271

Merged
JJJ merged 3 commits into
masterfrom
fix/released-declaration-fatals
Sep 23, 2026
Merged

JJJ merged 3 commits into
masterfrom
fix/released-declaration-fatals

Conversation

@JJJ

@JJJ JJJ commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Released 3.0.1 subclasses could fail at declaration time when 3.1 changed several extension signatures. Code extending the released comparison-operator class names also failed to autoload after those classes moved under Operators\Comparisons.

This change retains aliases for all 18 released comparison-operator class names and removes newly added native return types from selected released extension methods. Regression tests cover those contracts.

Three 3.1 signature changes remain intentional:

  • parse_args() is now an array helper with optional $defaults. Subclasses overriding the 3.0 construction hook must rename that override to consume_args() before upgrading. A remaining one-argument override causes a PHP declaration fatal.
  • Seven Column::is_*() predicates now accept an optional type argument. Subclasses overriding them must add that optional parameter before upgrading, or PHP rejects the subclass declaration.
  • Column::get_name_sql() now accepts an optional $cast argument directly. Subclasses overriding it must add that optional parameter before upgrading, or PHP rejects the subclass declaration.

The changelog documents these migrations. An audit of the known BerlinDB consumer repositories found no downstream overrides of these signature families; private consumers may still need to update.

Validation: local PHP 8.1 and 8.2 / WordPress 6.7 / MariaDB 10.2 full suites (1,792 tests, 4,028 assertions each), PHPStan level 8, PHPCS, and git diff --check. The latest get_name_sql() update passed the PHP 8.2 / MariaDB 10.2 full suite and local static checks.

@JJJ
JJJ force-pushed the fix/released-declaration-fatals branch 3 times, most recently from 9ab582b to da8a3d3 Compare September 22, 2026 23:28
@JJJ
JJJ force-pushed the fix/released-declaration-fatals branch from da8a3d3 to 0e012a5 Compare September 22, 2026 23:37
@JJJ JJJ changed the title Compatibility: preserve released declarations and operator names Compatibility: preserve key subclass contracts and operator names Sep 23, 2026
@JJJ
JJJ merged commit ac5bd65 into master Sep 23, 2026
6 checks passed
@JJJ
JJJ deleted the fix/released-declaration-fatals branch September 23, 2026 01:54
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