Skip to content

Conversation

@huangdijia
Copy link
Contributor

@huangdijia huangdijia commented Aug 31, 2025

This PR fixes wording/naming issues and clarifies deprecations.

Changes:

  • Replace 'Not Support job type.' with 'Unsupported job type.' in helpers
  • Correct 'will removed' → 'will be removed' across deprecation notes
  • Improve ReCaptcha configuration message when not published
  • Document EntryType::SCHEDULED_TASK as a deprecated alias of SCHEDULE
  • Rename DatabaseMessages → DatabaseMessage; update tests; add class_alias for backward compatibility
  • Tweak comments in cache ConfigProvider (Will be removed in v3.2)

Notes:

  • The rename is non-breaking via class_alias, but projects should migrate to DatabaseMessage.
  • SCHEDULED_TASK is marked deprecated and can be removed in v3.2.

Summary by CodeRabbit

  • 新功能

    • 新增 DatabaseMessage,用于承载数据库通知数据。
    • Telescope EntryType 增加常量别名 SCHEDULED_TASK(兼容 SCHEDULE)。
  • 重构

    • DatabaseMessages 标记为弃用并继承 DatabaseMessage,保持兼容。
  • 文档

    • 多处弃用说明语法修正(“will removed”改为“will be removed”),不影响行为与公开接口。
  • 样式

    • 优化错误/异常文案:dispatch 的默认错误提示改为“Unsupported job type.”;reCAPTCHA 配置未发布时提示更清晰。

…BC alias)

- Replace 'Not Support job type.' with 'Unsupported job type.'
- Correct 'will removed' → 'will be removed' in deprecations
- Improve ReCaptcha not published message
- Deprecate EntryType::SCHEDULED_TASK as alias of SCHEDULE
- Rename DatabaseMessages to DatabaseMessage; update tests; add class_alias for BC
- Tweak cache ConfigProvider comments
@coderabbitai
Copy link

coderabbitai bot commented Aug 31, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

本次变更主要修正多处注释中的弃用文案语法;新增通知模块的 DatabaseMessage 值对象,并将 DatabaseMessages 标记为弃用且继承自新类;更新部分错误/异常消息文本;在 Telescope 增加一个兼容性别名常量;相应更新了测试桩代码。

Changes

Cohort / File(s) Change Summary
Cache 注释修正
src/cache/src/CacheInterface.php, src/cache/src/Contract/CacheInterface.php, src/cache/src/ConfigProvider.php
修正弃用说明文案(“will removed”→“will be removed”);ConfigProvider 仅注释更正,无功能变更。
Support 弃用文案修正
src/support/src/Environment.php, src/support/src/Once/*
仅更正 @deprecated 文案语法,无逻辑改动。
Helpers 消息与注释
src/helpers/src/Functions.php
dispatch 的默认错误消息文案调整(“Not Support job type.”→“Unsupported job type.”);environment 的弃用注释语法修正。
Notification 新/旧消息类
src/notification/src/Message/DatabaseMessage.php, src/notification/src/Message/DatabaseMessages.php
新增 DatabaseMessage(构造函数属性提升,公开 array $data);DatabaseMessages 标记弃用并改为继承 DatabaseMessage,移除自身构造函数。
ReCaptcha 提示文案
src/recaptcha/src/ReCaptchaManager.php
未发布配置时的异常消息文案更改,逻辑不变。
Telescope 常量别名
src/telescope/src/EntryType.php
新增常量 SCHEDULED_TASK = 'schedule',作为 SCHEDULE 的别名并标记弃用。
测试同步更新
tests/Notification/Stubs/*
测试桩从 DatabaseMessages 切换为 DatabaseMessage,更新返回类型、use 语句与实例化。

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor App as Application
  participant Notifiable
  participant Notification
  participant Channel as DatabaseChannel
  participant DB as Database

  App->>Notification: 触发通知
  Notification->>Notifiable: 针对 Notifiable 构建负载
  Notification->>Channel: toDatabase() 返回 DatabaseMessage(data)
  Channel->>DB: 插入 data 到通知表
  DB-->>Channel: 写入结果
  Channel-->>App: 完成
  note over Channel,DB: 新增 DatabaseMessage;DatabaseMessages 现为继承且弃用
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Added CacheFlushed Event #850 — 同样改动了 src/cache/src/CacheInterface.php(该 PR 涉及接口与别名结构调整),与本次在同一文件的注释修改存在直接关联。

Suggested reviewers

  • guandeng

Poem

我在代码田里蹦蹦跳,
把 will removed 都梳好。
新瓶装上 DatabaseMessage,
旧友依偎暂退场。
星光照着 schedule 别名跑,
错误文案更礼貌。
胡萝卜一根——发布,收工喽! 🥕✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 PHPStan (2.1.17)

Note: Using configuration file /phpstan.neon.dist.
At least one path must be specified to analyse.


📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4c2e8f3 and 40410bc.

📒 Files selected for processing (13)
  • src/cache/src/CacheInterface.php (1 hunks)
  • src/cache/src/ConfigProvider.php (1 hunks)
  • src/cache/src/Contract/CacheInterface.php (1 hunks)
  • src/helpers/src/Functions.php (1 hunks)
  • src/notification/src/Message/DatabaseMessage.php (1 hunks)
  • src/notification/src/Message/DatabaseMessages.php (1 hunks)
  • src/recaptcha/src/ReCaptchaManager.php (1 hunks)
  • src/support/src/Environment.php (1 hunks)
  • src/support/src/Once/Backtrace.php (1 hunks)
  • src/support/src/Once/Cache.php (1 hunks)
  • src/telescope/src/EntryType.php (1 hunks)
  • tests/Notification/Stubs/NotificationDatabaseChannelCustomizeTypeTestNotification.php (1 hunks)
  • tests/Notification/Stubs/NotificationDatabaseChannelTestNotification.php (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/fix-naming-typos

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@huangdijia huangdijia merged commit 1affa28 into main Aug 31, 2025
15 of 16 checks passed
@huangdijia huangdijia deleted the chore/fix-naming-typos branch August 31, 2025 07:47
huangdijia added a commit that referenced this pull request Aug 31, 2025
…BC alias) (#892)

* chore: fix naming/spelling; rename DatabaseMessages→DatabaseMessage (BC alias)

- Replace 'Not Support job type.' with 'Unsupported job type.'
- Correct 'will removed' → 'will be removed' in deprecations
- Improve ReCaptcha not published message
- Deprecate EntryType::SCHEDULED_TASK as alias of SCHEDULE
- Rename DatabaseMessages to DatabaseMessage; update tests; add class_alias for BC
- Tweak cache ConfigProvider comments

* fix: update deprecation notice for DatabaseMessages class

* refactor: remove DatabaseMessages class and update deprecation notice for DatabaseMessage

---------

Co-Authored-By: Deeka Wong <8337659+huangdijia@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants