Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added translator for constants. #1137

Merged
merged 6 commits into from
Jan 3, 2020

Conversation

limingxinleo
Copy link
Member

@limingxinleo limingxinleo commented Dec 14, 2019

fix #1112

@limingxinleo
Copy link
Member Author

limingxinleo commented Dec 15, 2019 via email


// 1.2 版本以下 可以使用以下方式,但会在 1.2 版本移除

$message = ErrorCode::getMessage(ErrorCode::PARAMS_INVALID, 'user_id');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里意思是以后不再使用字符串格式化的方式来作为占位符了

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使用 字符串,但不再使用 ...$arguments 模式

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以这么写

$message = ErrorCode::getMessage(ErrorCode::PARAMS_INVALID, ['user_id']);

@limingxinleo limingxinleo merged commit d19a310 into hyperf:master Jan 3, 2020
@limingxinleo limingxinleo deleted the 1.1-constants branch January 3, 2020 06:48
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.

[FEATURE] 枚举能够支持多语言使用
3 participants