-
-
Notifications
You must be signed in to change notification settings - Fork 166
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
Plugin registration: named arguments #6337
Conversation
A couple first thoughts and steps:
|
@bastianallgeier we should keep the deprecation messages, but we can silence them first via https://github.com/getkirby/kirby/blob/main/src/Cms/Helpers.php#L31 |
@distantnative that's clever. I have to say that I never fully explored the options of the Helpers class. I just brought them back. |
83c9b98
to
d149380
Compare
@bastianallgeier I moved the |
One argument for a separate Inside an array, it could use |
Yea I really get that. I opted against it in the PR because I think it makes the whole setup a bit easier/consistent if not one of the info parts get it's extra treatment than others. But open to change this. |
Yeah, makes sense. If we want to make it possible to register plugins without a |
TBH, I would vote for separate named arguments if they are really relevant. In addition to that there could still be a meta or info pool. But the arrays of schema-less info have gotten us into so many difficult situations, so I would avoid them wherever possible. |
So all info values from composer json also as named arguments? |
I would really keep it simple for now and solve the version problem with this PR and then maybe add more later or think some more about an optional info array |
Ok. The optional info array we need anyways as this has been supported so far already, just as subentry of the |
@lukasbestle @bastianallgeier now with additional |
I'm thinking loud. Why don't we use the class Plugin
{
public function __construct(array $props) {
// check and set props
}
} This covers props to be added later/future and ensures consistency with other models. |
@afbora The |
This PR …
Background: #5764
Enhancement
Deprecated
info
orroot
in plugin extends array. Instead pass these as standalone named arguments.Docs
Ready?
For review team