sonata-project/SonataSeoBundle

BaseBreadcrumbMenuBlockService should not extends MenuBlockService

Closed this issue · 5 comments

Then we can make the Sonata\BlockBundle\Block\Service\MenuBlockService class final again.

sonata-project/SonataBlockBundle#761

Maybe we should completely rethink this component. A breadcrumb should have nothing to do with a BlockService.

My idea is something like this:

namespace Sonata\SeoBundle\Breadcrumb;

interface Breadcrumb {
    public function configureSettings(OptionsResolver $resolver): void;

    public function getMenu(array $options = []): ItemInterface;
}

There is already a BreadcrumbInterface. https://github.com/sonata-project/SonataSeoBundle/blob/a3a55dcaea4d3acd9284e842a09fe4b566b94cda/src/BreadcrumbInterface.php

If we remove the extends MenuBlockService and add some methods, it could be enough.

I have some trouble to find why we extending MenuBlockService indeed. But I never used this bundle.
Do you mind creating a PR/a draft @core23 ? :)

I have some trouble to find why we extending MenuBlockService indeed.

It has happend a long time ago when extend as many classes as possible was in vogue ;)

Do you mind creating a PR/a draft @core23 ? :)

Sadly I haven't much time for this huge refactoring. We also need some adjustments in the MenuBlock to get this thing working.

I have some trouble to find why we extending MenuBlockService indeed. But I never used this bundle.

I believe we did so to benefit from this piece of code: 84355f6#r42421762

We can close it and fix BaseBreadcrumbMenuBlockService in #446