microsoftgraph / microsoftgraph/msgraph-sdk-php

Deprecated nullable type causes a warning on PHP 8.4

オープン 初心者向け
#1,643 コメント 8 件 リアクション 4 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

status:waiting-for-triage type:bug
主要言語
PHP
スター
669
フォーク
150
平均マージ
15時間 21分
マージ済み PR(30日)
3

説明

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_

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

src/Requests/BaseBatchRequestBuilder.php の49行目付近から始め、レポートに示されているコンストラクターのシグネチャを確認してください。PHP 8.4 でクラスを実行し、非推奨警告を再現してください。コンストラクターがその警告を出力しなくなれば完了です。issue のコードベースに関するより広範な懸念に対処する場合に限り、他の nullable パラメーターも確認してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
php
領域
api
issue の種類
バグ
難易度
1/5
見積もり時間
1時間未満
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
68/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。