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

Move logic to a trait #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Move logic to a trait #44

wants to merge 1 commit into from

Conversation

Nyholm
Copy link
Collaborator

@Nyholm Nyholm commented Sep 11, 2021

This PR is for allow support for using a non-standard Kernel, ie Sulu is using their own SuluKernel (example).

@t-richard
Copy link
Member

So the idea would be that you can add this trait in the Kernel of a Sulu project and benefit from the heavy-lifting done by this bridge, right ?

Seems fine to me, PHPCS is failing but not sure about this warning to be honest.

Maybe this should also be documented in the README here ? Or even become the recommended way of using the bridge the default Symfony kernel too ? No strong opinion on this TBH 🙂

@Nyholm
Copy link
Collaborator Author

Nyholm commented Sep 15, 2021

So the idea would be that you can add this trait in the Kernel of a Sulu project and benefit from the heavy-lifting done by this bridge, right ?

Yes. Correct.

Seems fine to me, PHPCS is failing but not sure about this warning to be honest.

I dont know of a better name.

Maybe this should also be documented in the README here ?

Im not sure either. Users may still extend the BrefKernel if they want to. This PR is just to be compatible with other types of applications then the vanilla Symfony.

@mnapoli mnapoli added the enhancement New feature or request label Sep 15, 2021
Copy link
Member

@mnapoli mnapoli left a comment

Choose a reason for hiding this comment

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

Sounds good to me too, makes sense! I wouldn't make this the recommended default for now but it could be an option eventually.

As for the PHPCS warning, yeah I agree this is annoying here. BrefKernelTrait sounds good to me. Do you know if/how we could ignore that rule here? (I'd be fine with that)

@fferriere
Copy link

I need the job do in abstract BrefKernel, but I use custom kernel on my project, so I can't extend it.
I had begun to move code in trait like in this PR before to show it 😅.
Do you think this PR will be merged?

@t-richard
Copy link
Member

Sure, we can implement this if there's a need for it.

What's your current use case for this ?

@fferriere
Copy link

I work on a project which manage REST APIs from php-fpm and also deployed on lambda triggered by EventBridge. I understand it can be a bad practice, but we don't want to change this.
In this project, we have a custom Kernel which extends Symfony Kernel.
This Kernel is used from web Application, and we have created a Lambda Kernel, which manage the Log and Cache directory, extending the custom Kernel.
With this architecture, we can't extend the BrefKernel because we already extend our custom Kernel.
A BrefKernelTrait is a good way for us.

@mnapoli
Copy link
Member

mnapoli commented Feb 21, 2023

Just an update here, I'm 👍 to merge that PR (needs a rebase) or another that is up to date, if anyone wants to tackle that.

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

Successfully merging this pull request may close these issues.

4 participants