-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add scopehint on the category edit form #27
base: master
Are you sure you want to change the base?
Add scopehint on the category edit form #27
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for working on this! I commented two minor things, which I found :) I wouldn't consider them necessary, though.
Hi @avstudnitz, do you consider merging this feature or is it a no-go? |
$this->registry = $registry; | ||
$this->categoryRepository = $categoryRepository; | ||
$this->escaper = $escaper; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @thedotwriter
I would use the "constructor property promotion" introduced in PHP 8.0.
the properties are declared directly in the constructor which is a more concise and clean way to define class properties.
Example:
class CategoryFieldPlugin
{
/**
* @param StoreManagerInterface $storeManager
* @param Registry $registry
* @param CategoryRepositoryInterface $categoryRepository
* @param Escaper $escaper
*/
public function __construct(
public readonly StoreManagerInterface $storeManager,
public readonly Registry $registry,
public readonly CategoryRepositoryInterface $categoryRepository,
public readonly Escaper $escaper,
) {}
// rest of code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for checking this PR. This code is indeed quite old now. I will consider updating it if I ever get a feedback from the repo owner : p (@avstudnitz)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Well done btw!
Hope that this is approved and merged soon.
Hi,
Here's a feature I really wanted from this module. I adapted the \AvS\ScopeHint\Plugin\ProductEavDataProviderPlugin for the category edit form. I tried to stay close to the module coding style.
Check it out and tell me what you think.
Cheers