Skip to content

Emit error when unsupported attributes are used #464

@kakserpom

Description

@kakserpom

Master branch (660f308):


#[php_class(name = "MyClass")]
pub struct _MyClass {}

#[php_impl]
impl _MyClass {
    pub fn __construct() -> Self {
        Self {}
    }
}

#[php_class(name = "MyNamespace\\MyOtherClass")]
pub struct MyOtherClass {}

#[php_impl]
impl MyOtherClass {
    pub fn __construct() -> Self {
        Self {}
    }
}

#[php_module]
pub fn get_module(module: ModuleBuilder) -> ModuleBuilder {
    module.class::<_MyClass>().class::<MyOtherClass>()
}
<?php
var_dump(new MyClass);
new MyNamespace\MyOtherClass;
object(MyClass)#1 (0) {
}
PHP Fatal error:  Uncaught Error: Class "MyNamespace\MyOtherClass" not found in test.php:3

It works well on the latest release (0.13.1).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestmacrosRelated to macros

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions