Skip to content

PHP 8.4.x deprecation warnings #235

Open

Description

@k3rielit

With the release of PHP 8.4, implicitly marking parameters as nullable is now deprecated.

The dev-master version of this package contains a few warnings because of this:

<warning> DEPRECATED </warning> cebe\openapi\SpecBaseObject::resolveReferences(): Implicitly marking parameter $context as nullable is deprecated, the explicit nullable type must be used instead in vendor/cebe/php-openapi/src/SpecBaseObject.php on line 396.
<warning> DEPRECATED </warning> cebe\openapi\SpecObjectInterface::resolveReferences(): Implicitly marking parameter $context as nullable is deprecated, the explicit nullable type must be used instead in vendor/cebe/php-openapi/src/SpecObjectInterface.php on line 43.
<warning> DEPRECATED </warning> cebe\openapi\spec\Paths::resolveReferences(): Implicitly marking parameter $context as nullable is deprecated, the explicit nullable type must be used instead in vendor/cebe/php-openapi/src/spec/Paths.php on line 249.
<warning> DEPRECATED </warning> cebe\openapi\spec\PathItem::resolveReferences(): Implicitly marking parameter $context as nullable is deprecated, the explicit nullable type must be used instead in vendor/cebe/php-openapi/src/spec/PathItem.php on line 153.
<warning> DEPRECATED </warning> cebe\openapi\spec\Responses::resolveReferences(): Implicitly marking parameter $context as nullable is deprecated, the explicit nullable type must be used instead in vendor/cebe/php-openapi/src/spec/Responses.php on line 239.
<warning> DEPRECATED </warning> cebe\openapi\spec\Reference::__construct(): Implicitly marking parameter $to as nullable is deprecated, the explicit nullable type must be used instead in vendor/cebe/php-openapi/src/spec/Reference.php on line 72.
<warning> DEPRECATED </warning> cebe\openapi\spec\Reference::resolve(): Implicitly marking parameter $context as nullable is deprecated, the explicit nullable type must be used instead in vendor/cebe/php-openapi/src/spec/Reference.php on line 179.
<warning> DEPRECATED </warning> cebe\openapi\spec\Reference::resolveReferences(): Implicitly marking parameter $context as nullable is deprecated, the explicit nullable type must be used instead in vendor/cebe/php-openapi/src/spec/Reference.php on line 366.

Example:

public function resolveReferences(ReferenceContext $context = null); // SpecObjectInterface.php #43

Activity

  1. SOHELAHMED7 commented on May 5, 2025

    @SOHELAHMED7
    Contributor

    Fixed in #217

  2. anyx commented on Jun 23, 2025

    @anyx

    @cebe can you merge #217, please?

  3. renky commented on Aug 25, 2025

    @renky

    @cebe i know it is already on the Milstone 1.9.0 - but in meanwhile php8.4 gets more and more mainstream - is it possible to merge this in some way and maybe add a 1.8.1 in between?

  4. Artemeey commented on Nov 25, 2026

    @Artemeey

    These eight notices are fixed in a published build: artemeey/php-openapi 1.8.1 — the same code with explicit nullable types, so this removes the deprecations today:

    composer require artemeey/php-openapi:^1.8.1

    Upstream patch for review: #259. Not a BC break — ?T $x = null accepts the same arguments and works on PHP 7.1+. If a deprecation still appears, please post the PHP version and the exact file/line in #259 or as a new issue here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions