Skip to content

support of php attributes #90

@eric-therond

Description

@eric-therond

I would like to improve php-cfg to add information about php attributes in the CFG.

For this code sample:

#[ExampleAttribute('Hello world', 42)]
class NameOfClass {
}

Do you think the following output to generate is correct?

Block#1
    Stmt_Class
        name: LITERAL('NameOfClass')
        stmts: Block#2
        attrs_group: Block#3

Block#2

Block#3
    AttributeGroup
        attrs[0]: Block#4

Block#4
    Attribute
        name: LITERAL('ExampleAttribute')
        args[0]: LITERAL('Hello world')
        args[1]: LITERAL(42)

Eric

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions