Skip to content

Support PHP 8.5: make implicit nullable parameter types explicit - #259

Open
Artemeey wants to merge 1 commit into
cebe:masterfrom
Artemeey:php-85-support
Open

Artemeey wants to merge 1 commit into
cebe:masterfrom
Artemeey:php-85-support

Conversation

@Artemeey

@Artemeey Artemeey commented Nov 25, 2026 •

Copy link
Copy Markdown

PHP 8.5 deprecates implicitly nullable parameter types (Foo $bar = null), so every affected declaration emits E_DEPRECATED on load. This makes them explicit:

  • SpecObjectInterface, SpecBaseObject, spec/Callback, spec/PathItem, spec/Paths, spec/Responses — resolveReferences()
  • spec/Reference — __construct(), resolve(), resolveReferences()

No behaviour change: ?T $x = null accepts the same arguments as T $x = null and still works on PHP 7.1+.

Fix available now

Latest version

Published from this branch as artemeey/php-openapi — https://packagist.org/packages/artemeey/php-openapi

composer require artemeey/php-openapi:^1.8.1

The package contains exactly this diff (only the package name differs), so projects can drop the deprecation notices before the patch lands upstream.

Supersedes #254.

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