Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Add preliminary support for enums#201

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jmjoy merged 6 commits intophper-framework:masterfromjmjoy:feat
Apr 6, 2025

Conversation

jmjoy
Copy link
Member

This pull request introduces significant changes to thephper project, adding support for PHP enums, improving documentation, and making several internal adjustments to enhance functionality and maintainability.

Enum Support:

  • Added a new modulephper::enums to provide Rust wrappers for PHP enum functionality, supporting pure enums, integer-backed enums, and string-backed enums.
  • Updatedphper-build/src/lib.rs to include configuration forphper_enum_supported when PHP version is 8.1 or higher.
  • Included documentation on how to register enums inphper-doc/doc/_06_module/_08_register_enum/index.md.
  • Modifiedphper-doc/src/lib.rs to include the new enum registration documentation module.
  • Added necessary includes for enums inphper-sys/php_wrapper.c.

Documentation and Configuration:

  • EnhancedCargo.toml to include thesealed crate and updated documentation configurations.[1][2]
  • Enabled conditional compilation attributes for documentation inphper/src/lib.rs.

Internal Adjustments:

  • Made several internal structs and functions inphper/src/classes.rs public within the crate for broader usage.[1][2][3][4][5]
  • IncludedEnumEntity in thephper/src/modules.rs module imports.

@jmjoy
Copy link
MemberAuthor

Solve#161

@jmjoyjmjoy marked this pull request as ready for reviewApril 6, 2025 00:19
@jmjoyjmjoy merged commitc66a28f intophper-framework:masterApr 6, 2025
22 checks passed
@jmjoyjmjoy deleted the feat branchApril 6, 2025 00:19
@frederikbosch
Copy link

Fantastic, great work. Thank you.

@frederikbosch
Copy link

As I am directly implementing this in myext-fs-notify library, I am wondering how to construct an enum from the Rust side. I'd like to return it from a method. I can add a docs-PR for that once I know how to do it.

@jmjoy
Copy link
MemberAuthor

As I am directly implementing this in myext-fs-notify library, I am wondering how to construct an enum from the Rust side. I'd like to return it from a method. I can add a docs-PR for that once I know how to do it.

Your request requires further improvement of the enums API, using the PHP functionzend_enum_get_case_cstr. I’ll add support for this later.

frederikbosch reacted with thumbs up emoji

@frederikbosch
Copy link

That's great. I wish I could you with that, but I am afraid I can't. The knowledge gap I have to bridge is one I cannot make right now. Thanks again for your efforts.

jmjoy reacted with thumbs up emoji

@jmjoy
Copy link
MemberAuthor

That's great. I wish I could you with that, but I am afraid I can't. The knowledge gap I have to bridge is one I cannot make right now. Thanks again for your efforts.

Please refer tohttps://github.com/phper-framework/phper/blob/master/phper-doc/doc/_06_module/_08_register_enum/index.md#using-enumcase-for-direct-access

godruoyi reacted with thumbs up emoji

@github-actionsgithub-actionsbot mentioned this pull requestMay 1, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@jmjoy@frederikbosch

[8]ページ先頭

©2009-2025 Movatter.jp