Skip to content

Make ReindexProvider getIndex none static #615

@alexander-schranz

Description

@alexander-schranz

The idea behind that we did make the method of the ReindexProvider static:

    public static function getIndex(): string;

was that static methods are able to be called without instantiate the class trigger lazy service to be loaded.

The problem is if we want reuse a ReindexProvider for example when creating a Index per language we would require to create a Reindex class also per language. As languages are in Sulu depending on other service it would be best to make it none static so something like:

    public function getIndex(): string
    {
        return 'website' . $this->locale;
    }

Can be implemented.

Sadly this would be kind of BC break: https://3v4l.org/nfFFJ not sure why but PHP does not allow that a implementation does make a method of interface static.

@Toflar think you also had in contao once request similar change? But as the name != real index name you could workaround it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DXImproves the developer experienceRequire BC BreakRequires a BC Break and so new major versionSEAL CoreSeal Core related issue

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions