Skip to content

Feat/interface impl #533

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

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

Norbytus
Copy link
Contributor

@Norbytus Norbytus commented Jul 20, 2025

Description

  • Add interface registration

❤️ Thank you for your contribution!

This was referenced Jul 20, 2025
@@ -28,8 +28,17 @@ pub struct StructAttributes {

#[derive(FromMeta, Debug)]
pub struct ClassEntryAttribute {
ce: syn::Expr,
stub: String,
pub ce: syn::Expr,
Copy link
Contributor Author

@Norbytus Norbytus Jul 20, 2025

Choose a reason for hiding this comment

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

Make pub cause not see necessary to duplicate

@@ -131,6 +131,41 @@ impl<'a> Function<'a> {
format_ident!("_internal_{}", &self.ident)
}

pub fn abstract_function_builder(&self) -> TokenStream {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Make new builder, cause for interface we don't need a CallType


impl CleanPhpAttr for Vec<Attribute> {
fn clean_php(&mut self) {
self.retain(|attr| !attr.path().is_ident("php"));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just tired write retain for php everywhere))

@@ -125,7 +125,7 @@ struct ParsedImpl<'a> {
}

#[derive(Debug, Eq, Hash, PartialEq)]
enum MethodModifier {
pub enum MethodModifier {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Make public to not duplicate

@@ -141,7 +141,7 @@ impl quote::ToTokens for MethodModifier {
}

#[derive(Debug)]
struct FnBuilder {
pub struct FnBuilder {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Make public to not duplicate

@@ -151,13 +151,19 @@ struct FnBuilder {
}

#[derive(Debug)]
struct Constant<'a> {
pub struct Constant<'a> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Make public to not duplicate

@Norbytus Norbytus force-pushed the feat/interface_impl branch 2 times, most recently from df8ad81 to 8a46b3a Compare July 21, 2025 15:59
@coveralls
Copy link

coveralls commented Jul 21, 2025

Pull Request Test Coverage Report for Build 16880353614

Details

  • 8 of 179 (4.47%) changed or added relevant lines in 9 files are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-1.0%) to 26.825%

Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/macros/src/helpers.rs 0 2 0.0%
crates/macros/src/class.rs 0 5 0.0%
crates/macros/src/lib.rs 0 5 0.0%
src/builders/class.rs 6 13 46.15%
src/describe/stub.rs 0 17 0.0%
crates/macros/src/function.rs 0 20 0.0%
src/builders/module.rs 0 23 0.0%
crates/macros/src/interface.rs 0 92 0.0%
Files with Coverage Reduction New Missed Lines %
src/builders/class.rs 1 57.14%
src/describe/stub.rs 1 6.51%
Totals Coverage Status
Change from base Build 16813466135: -1.0%
Covered Lines: 1161
Relevant Lines: 4328

💛 - Coveralls

#[php_interface]
#[php(extends(ce = ce::throwable, stub = "\\Throwable"))]
#[php(name = "ExtPhpRs\\Interface\\EmptyObjectInterface")]
pub trait EmptyObjectTrait
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Xenira you test for expand, i try make same as you in enum. But get error, i miss something, but idk what)

@Norbytus Norbytus force-pushed the feat/interface_impl branch 5 times, most recently from 1cdd123 to 2abe85f Compare July 23, 2025 17:55
@Norbytus Norbytus force-pushed the feat/interface_impl branch from c4f06b9 to a1a49ca Compare August 4, 2025 14:40
@Norbytus Norbytus force-pushed the feat/interface_impl branch from a1a49ca to b98feae Compare August 10, 2025 14:50
@Norbytus Norbytus force-pushed the feat/interface_impl branch from f28ffa1 to b5788e1 Compare August 10, 2025 18:03
@Norbytus Norbytus force-pushed the feat/interface_impl branch from b5788e1 to 3f709ab Compare August 10, 2025 18:06
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