Regression: missing @return annotation on Psr7\Stream::getMetadata() causes symfony/error-handler deprecation again (was fixed in #703 for #701)
まだ誰も着手していません。
評価
調査の方向性
lib/Http/Psr7/Stream.php から始めて getMetadata() を調べ、続いて #703 の以前の修正と、それに対応する src/Http/Psr7/Stream.php の変更を比較します。annotation が codegen の spec または template から生成されているか確認します。Symfony DebugClassLoader でクラスを読み込んだときに deprecation が発生しなくなり、再生成後も annotation が保持されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Description
Algolia\AlgoliaSearch\Http\Psr7\Stream::getMetadata() no longer has an explicit @return PHPDoc annotation, which causes symfony/error-handler's DebugClassLoader to emit a deprecation notice when the class is loaded:
User Deprecated: Method "Psr\Http\Message\StreamInterface::getMetadata()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Algolia\AlgoliaSearch\Http\Psr7\Stream" now to avoid errors or add an explicit @return annotation to suppress this message.
This is a regression: the same issue was already reported in #701 and fixed in #703 (merged 2022), which added @return array|mixed|null above getMetadata() in src/Http/Psr7/Stream.php (along with annotations on Request.php, Uri.php, and a few Response classes).
On the current release, the annotation is missing again on lib/Http/Psr7/Stream.php:
public function getMetadata($key = null)
{
if (!isset($this->stream)) {
My guess is this got dropped by a regeneration of the SDK from its codegen spec, since the fix was a manual addition to a generated file rather than something enforced by the generator/templates.
Steps To Reproduce
Load Algolia\AlgoliaSearch\Http\Psr7\Stream in an app using symfony/error-handler's DebugClassLoader (e.g. any Symfony app in dev/test env), and call getMetadata() (it's called internally from the constructor via $this->uri = $this->getMetadata('uri');).
Expected behavior
No deprecation notice, consistent with the fix in #703.
Versions
- Algolia Client Version: 4.47.0
- PHP: 8.4
cc @jeromevieilledent-qobuz
- 主要言語
- PHP
- スター
- 696
- フォーク
- 111
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
algolia/algoliasearch-client-php のほかの issue
-
[bug]: Please tag a new major version when introducing BC breaks再び着手できるかも @Fluf22 が 216 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
algolia/algoliasearch-client-php#760 · コメント 5 件 · リアクション 1 件 · 担当者 1 名 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
algolia/algoliasearch-client-php#753 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
[bug]: Use enumsオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
algolia/algoliasearch-client-php#748 · コメント 1 件 ·
-
[bug]: BC Break starting v4.10.0 for batch operations in SearchClient再び着手できるかも @damcou が 680 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
algolia/algoliasearch-client-php#744 · コメント 2 件 · 担当者 1 名 ·
algolia/algoliasearch-client-php の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Configuration consistency enhancement
難易度 2/5 1時間未満 初心者へのやさしさ 72/100
novalo-dev/Prestashop-MCP-Server#405 ·
メンテナーはふだん 1 日以内に返信
-
OpenRouter errors returned in a 200 body are thrown as a plain AiException対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
freescout-help-desk/freescout#5844 ·
メンテナーはふだん 1 日以内に返信
-
sync-en
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信