Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Deprecated warnings in PHP 8.2

未关闭
#250 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
php
领域
api

调研方向

先从警告中提到的 cebe/openapi Paths.php、Responses.php 和 JsonReference.php 文件开始,然后将它们的方法签名与 issue 中列出的 PHP 8.2 接口进行比较。进行更改前,检查项目测试或 PHP 兼容性设置。完成的标准是:在 PHP 8.2 下不再出现报告的弃用警告。

由索引模型根据 Issue 内容生成。

描述

Warning logs

[2025-10-30T16:51:17.688343-03:00] API.NOTICE: PHP Notice: Return type of cebe\openapi\spec\Paths::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice {"severity":"E_DEPRECATED","file":"/var/www/vendor/cebe/php-openapi/src/spec/Paths.php","line":186} []
[2025-10-30T16:51:17.688747-03:00] API.NOTICE: PHP Notice: Return type of cebe\openapi\spec\Paths::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice {"severity":"E_DEPRECATED","file":"/var/www/vendor/cebe/php-openapi/src/spec/Paths.php","line":197} []
[2025-10-30T16:51:17.689014-03:00] API.NOTICE: PHP Notice: Return type of cebe\openapi\spec\Paths::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice {"severity":"E_DEPRECATED","file":"/var/www/vendor/cebe/php-openapi/src/spec/Paths.php","line":208} []
[2025-10-30T16:51:17.689207-03:00] API.NOTICE: PHP Notice: Return type of cebe\openapi\spec\Paths::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice {"severity":"E_DEPRECATED","file":"/var/www/vendor/cebe/php-openapi/src/spec/Paths.php","line":218} []
[2025-10-30T16:51:17.689431-03:00] API.NOTICE: PHP Notice: Return type of cebe\openapi\spec\Paths::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice {"severity":"E_DEPRECATED","file":"/var/www/vendor/cebe/php-openapi/src/spec/Paths.php","line":229} []
[2025-10-30T16:51:17.689516-03:00] API.NOTICE: PHP Notice: Return type of cebe\openapi\spec\Paths::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice {"severity":"E_DEPRECATED","file":"/var/www/vendor/cebe/php-openapi/src/spec/Paths.php","line":239} []
[2025-10-30T16:51:17.689789-03:00] API.NOTICE: PHP Notice: Return type of cebe\openapi\spec\Responses::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice {"severity":"E_DEPRECATED","file":"/var/www/vendor/cebe/php-openapi/src/spec/Responses.php","line":176} []
[2025-10-30T16:51:17.690206-03:00] API.NOTICE: PHP Notice: Return type of cebe\openapi\spec\Responses::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice {"severity":"E_DEPRECATED","file":"/var/www/vendor/cebe/php-openapi/src/spec/Responses.php","line":187} []
[2025-10-30T16:51:17.690363-03:00] API.NOTICE: PHP Notice: Return type of cebe\openapi\spec\Responses::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice {"severity":"E_DEPRECATED","file":"/var/www/vendor/cebe/php-openapi/src/spec/Responses.php","line":198} []
[2025-10-30T16:51:17.690539-03:00] API.NOTICE: PHP Notice: Return type of cebe\openapi\spec\Responses::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice {"severity":"E_DEPRECATED","file":"/var/www/vendor/cebe/php-openapi/src/spec/Responses.php","line":208} []
[2025-10-30T16:51:17.690608-03:00] API.NOTICE: PHP Notice: Return type of cebe\openapi\spec\Responses::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice {"severity":"E_DEPRECATED","file":"/var/www/vendor/cebe/php-openapi/src/spec/Responses.php","line":219} []
[2025-10-30T16:51:17.690770-03:00] API.NOTICE: PHP Notice: Return type of cebe\openapi\spec\Responses::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice {"severity":"E_DEPRECATED","file":"/var/www/vendor/cebe/php-openapi/src/spec/Responses.php","line":229} []
[2025-10-30T16:51:17.691040-03:00] API.NOTICE: PHP Notice: Return type of cebe\openapi\json\JsonReference::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice {"severity":"E_DEPRECATED","file":"/var/www/vendor/cebe/php-openapi/src/json/JsonReference.php","line":129} []

composer show command

root@e22d479c12fd:/var/www# composer show  
cebe/php-openapi              1.6.0  Read and write OpenAPI yaml/json files and make the content accessable in PHP objects.
devizzent/cebe-php-openapi    1.0.3  Read and write OpenAPI yaml/json files and make the content accessable in PHP objects.
fig/http-message-util         1.1.5  Utility classes and constants for use with PSR-7 (psr/http-message)
graham-campbell/result-type   1.1.3  An Implementation Of The Result Type
justinrainbow/json-schema     5.3.0  A library to validate a json schema.
laravel/serializable-closure  2.0.6  Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.
league/openapi-psr7-validator 0.22   Validate PSR-7 messages against OpenAPI (3.0.2) specifications expressed in YAML or JSON
league/uri                    7.5.1  URI manipulation library
league/uri-interfaces         7.5.0  Common interfaces and classes for URI representation and interaction
monolog/monolog               3.9.0  Sends your logs to files, sockets, inboxes, databases and various web services
nikic/fast-route              1.3.0  Fast request router for PHP
php-di/invoker                2.3.7  Generic and extensible callable invoker
php-di/php-di                 7.1.1  The dependency injection container for humans
phpoption/phpoption           1.9.4  Option Type for PHP
pimple/pimple                 3.5.0  Pimple, a simple Dependency Injection Container
psr/cache                     3.0.0  Common interface for caching libraries
psr/container                 2.0.2  Common Container Interface (PHP FIG PSR-11)
psr/http-factory              1.1.0  PSR-17: Common interfaces for PSR-7 HTTP message factories
psr/http-message              2.0    Common interface for HTTP messages
psr/http-server-handler       1.0.2  Common interface for HTTP server-side request handler
psr/http-server-middleware    1.0.2  Common interface for HTTP server-side middleware
psr/log                       3.0.2  Common interface for logging libraries
ralouphie/getallheaders       3.0.3  A polyfill for getallheaders.
respect/stringifier           0.2.0  Converts any value to a string
respect/validation            2.4.4  The most awesome validation engine ever created for PHP
riverline/multipart-parser    2.2.0  One class library to parse multipart content with encoding and charset support.
slim/psr7                     1.7.1  Strict PSR-7 implementation
slim/slim                     4.15.0 Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs
symfony/deprecation-contracts 3.6.0  A generic function and convention to trigger deprecation notices
symfony/polyfill-ctype        1.33.0 Symfony polyfill for ctype functions
symfony/polyfill-mbstring     1.33.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php80        1.33.0 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
symfony/yaml                  6.4.26 Loads and dumps YAML files
vlucas/phpdotenv              5.6.2  Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.
webmozart/assert              1.12.1 Assertions to validate method input/output with nice error messages.
主要语言
PHP
星标
500
派生
99
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

cebe/php-openapi 的其他 Issue

查看 cebe/php-openapi 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。