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

Initial Service Manager v4 Support #136

Merged
merged 17 commits into from
Jun 13, 2024
Merged

Conversation

gsteel
Copy link
Member

@gsteel gsteel commented Apr 3, 2024

Provides initial support for SMv4

There is still a fair bit of work to do where the FilterPluginManager is consumed by FilterChain + other filters. These will need to be refactored with the FilterPluginManager as a hard-dependency in the constructor, otherwise none of the aliases will work now they have been extracted to the config provider.

Closes #125

gsteel added 15 commits April 4, 2024 00:44
- Drop inclusion of i18n filters
- Drop legacy SMv2 validation

Signed-off-by: George Steel <[email protected]>
…ires options.

`AbstractPluginManager::get()` no longer has an `options` parameter.

Signed-off-by: George Steel <[email protected]>
Signed-off-by: George Steel <[email protected]>
…uration variables from abstract plugin manager

Signed-off-by: George Steel <[email protected]>
- Remove fragile and now incorrect examination if plugin manager internals
- Fix configuration where an alias will no longer resolve because the plugin manager does not self-define all known filters

Signed-off-by: George Steel <[email protected]>
Wires up factories and aliases as configured in the package ConfigProvider so that the created plugin manager is functional.

Signed-off-by: George Steel <[email protected]>
…n service manager.

The test trait shipped on service manager cannot be used because it is designed for `SingleInstancePluginManager` which `FilterPluginManager` cannot inherit from.

Signed-off-by: George Steel <[email protected]>
Signed-off-by: George Steel <[email protected]>
Signed-off-by: George Steel <[email protected]>
src/Module.php Outdated Show resolved Hide resolved
Copy link
Member

@boesing boesing left a comment

Choose a reason for hiding this comment

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

LGTM. Like to see first plugin manager to not implement the AbstractSingleInstancePluginManager class as we do have to allow callable and FilterInterface types.

However, I would keep the plugin manager configuration in the plugin manager to prevent too much of a BC break. Especially a break which is not really necessary IMO.

src/ConfigProvider.php Outdated Show resolved Hide resolved
@boesing
Copy link
Member

boesing commented Apr 4, 2024

I wonder if we should provide a CallableFilter with v4 so that we do not have this mixed stuff laying around.
Just not 100% sure where and how to map callables to the CallableFilter but that would at least reduce complexity a little bit. Just some thought which came to my mind, nothing we have to do - just wanted to drop that here.

@gsteel
Copy link
Member Author

gsteel commented Apr 4, 2024

I wonder if we should provide a CallableFilter with v4 so that we do not have this mixed stuff laying around.
Just not 100% sure where and how to map callables to the CallableFilter but that would at least reduce complexity a little bit. Just some thought which came to my mind, nothing we have to do - just wanted to drop that here.

I was thinking the same thing. Probably worth exploring in a separate patch

To reduce BC breaks, retain the concept of default configuration of the plugin manager, moving configuration out of the ConfigProvider and into a class constant.

Signed-off-by: George Steel <[email protected]>
@gsteel
Copy link
Member Author

gsteel commented Jun 13, 2024

@boesing - I'd appreciate another review when you get a chance! Cheers.

@boesing
Copy link
Member

boesing commented Jun 13, 2024

will do later, have to take a 4h train and thus need some stuff to do 😁

src/FilterChain.php Outdated Show resolved Hide resolved
Copy link
Member

@boesing boesing left a comment

Choose a reason for hiding this comment

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

LGTM, just a few questions but overall pretty neat work.

… to descendants of `FilterInterface`

Signed-off-by: George Steel <[email protected]>
@gsteel
Copy link
Member Author

gsteel commented Jun 13, 2024

TYVM @boesing 🙏

@gsteel gsteel self-assigned this Jun 13, 2024
@gsteel gsteel merged commit 62217bf into laminas:3.0.x Jun 13, 2024
11 checks passed
@gsteel gsteel deleted the service-manager-v4 branch June 13, 2024 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants