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

bring back the named constructor #1162

Open
c33s opened this issue Jan 22, 2024 · 3 comments
Open

bring back the named constructor #1162

c33s opened this issue Jan 22, 2024 · 3 comments
Labels

Comments

@c33s
Copy link

c33s commented Jan 22, 2024

i am migrating an older symfony project to 7.0 where i also updated alice.

sadly alice made a big step back, according the readme the constructor now has to be an array

    service_text:
        __construct:
            name: Name
            short_name: editorial
            percent: 93
            icon: basic-book-pen
            description: Description
            visible: true
            rank: 60
vvv
    service_text:
        __construct:
            - Name
            - editorial
            - 93
            - basic-book-pen
            - Description
            - true
            - 60

rewriting all the fixtures and removing valuable information to have a result which is much less readable feels more than wrong. having php supporting named arguments while removing names from alice feels wrong for me.

any chance to get back name constructor?

@theofidry
Copy link
Member

any chance to get back name constructor?

Unlikely unless someone is willing to work on it :)

having php supporting named arguments while removing names from alice feels wrong for me.

If PHP supported it at that time I would not have done it, but this is from 7-8 years ago

@c33s
Copy link
Author

c33s commented Jan 23, 2024

or would some kind of a hack be acceptible? check if it is a named array and convert it to a values array should do the trick. would this be hard to implement?

@theofidry
Copy link
Member

I honestly have no idea what it would take, but given the current architecture I wouldn't think it would be too hard to implement. It's been a really long time since I took a close look at the codebase though so I could be wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants