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

Deprecate Pool param for SearchHandler #6308

Merged
merged 1 commit into from
Aug 22, 2020

Conversation

VincentLanglet
Copy link
Member

Subject

I am targeting this branch, because BC.

See #6307 (comment)

Changelog

### Deprecated
- Passing a Pool to SearchHandler class

@VincentLanglet VincentLanglet requested a review from a team August 22, 2020 10:06
greg0ire
greg0ire previously approved these changes Aug 22, 2020
Copy link
Contributor

@greg0ire greg0ire left a comment

Choose a reason for hiding this comment

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

The simplification in the tests feels good :)

@VincentLanglet VincentLanglet requested a review from a team August 22, 2020 10:59
@jordisala1991
Copy link
Member

Shouldnt you change the xml config?

@VincentLanglet
Copy link
Member Author

Shouldnt you change the xml config?

I forgot. I don't use conf anymore on my project.
Fixed.

*/
public function __construct(Pool $pool, $caseSensitive = true)
public function __construct($deprecatedPoolOrCaseSensitive, $caseSensitive = true)
Copy link
Member

Choose a reason for hiding this comment

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

maybe we should add = true as default value?

Copy link
Member Author

@VincentLanglet VincentLanglet Aug 22, 2020

Choose a reason for hiding this comment

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

The previous next major comment was

NEXT_MAJOR: remove default true value for $caseSensitive and add bool type hint.

So I didn't add the default true value. But I don't know why we didn't want a default value indeed.

EDIT: the default value was remove in master.

Copy link
Member

Choose a reason for hiding this comment

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

Well then lets leave it without default

Copy link
Member

@jordisala1991 jordisala1991 left a comment

Choose a reason for hiding this comment

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

Nice one! The Pool is only a service locator for admins? Maybe we can use Symfony directly for that. Just to think about it, nothing to change here

@VincentLanglet
Copy link
Member Author

Nice one! The Pool is only a service locator for admins? Maybe we can use Symfony directly for that.

It could be great indeed to improve/remove the Pool.

For instance there is a lot of $this->pool->getPropertyAccessor() calls. We should inject the propertyAccessor directly.

There is also a $this->pool->getContainer()->get($templateRegistryId); call.

@jordisala1991
Copy link
Member

There is also a $this->pool->getContainer()->get($templateRegistryId); call.

This one could be related with the issue we had on the Pr that adds support for sf5 on master. Not having a template registry service locator made a block on that PR

@VincentLanglet VincentLanglet merged commit 4f4accd into sonata-project:3.x Aug 22, 2020
@VincentLanglet VincentLanglet deleted the searchHandler branch August 22, 2020 14:12
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

Successfully merging this pull request may close these issues.

3 participants