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

[Question] Make MicroKernel a first-class citizen? #25

Closed
javiereguiluz opened this issue Apr 4, 2017 · 2 comments
Closed

[Question] Make MicroKernel a first-class citizen? #25

javiereguiluz opened this issue Apr 4, 2017 · 2 comments

Comments

@javiereguiluz
Copy link
Member

In previous Smyfony versions, microkernel was a questionable feature, added without much enthusiasm and implemented as a trait.

But in the new Symfony paradigm, the microkernel is a central part of it. Why not make it a real PHP class instead of a trait?


Before:

use Symfony\Component\HttpKernel\Kernel as BaseKernel;

class Kernel extends BaseKernel
{
    use MicroKernelTrait;

    // ...
}

After:

use Symfony\Component\HttpKernel\MicroKernel;

class Kernel extends MicroKernel
{
    // ...
}
@nicolas-grekas
Copy link
Member

nicolas-grekas commented Apr 4, 2017

IMHO, because a MicroKernel is not a type, but a pure behavior. Making it a class would make it a type (ie one could do instanceof MicroKernel), which would be bad.

@fabpot
Copy link
Member

fabpot commented Apr 4, 2017

I agree with @nicolas-grekas. That let's you have your own derivative of Kernel, but still have the behavior defined in the trait.

@fabpot fabpot closed this as completed Apr 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants