Skip to content

Deprecated nullable type causes a warning on PHP 8.4 #1643

Open
@Marian-Kechlibar

Description

@Marian-Kechlibar

Describe the bug

This is a mostly self-explaining problem whose fix is, fortunately, very simple - literally one extra letter.

Deprecated: Microsoft\Graph\Core\Requests\BaseBatchRequestBuilder::__construct(): Implicitly marking parameter $errorMappings as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/vendor/microsoft/microsoft-graph-core/src/Requests/BaseBatchRequestBuilder.php on line 49

Looking at the signature of the constructor

public function __construct(RequestAdapter $requestAdapter, array $errorMappings = null)

should be

public function __construct(RequestAdapter $requestAdapter, ?array $errorMappings = null)

Maybe the whole codebase should be scanned for this deprecation... these will become errors in PHP 9.

Expected behavior

No deprecation warning.

How to reproduce

Run anything with this class under PHP 8.4

SDK Version

2.25.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:waiting-for-triageAn issue that is yet to be reviewed or assignedtype:bugA broken experience

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions