-
Notifications
You must be signed in to change notification settings - Fork 102
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
Fixed plugin generation issues #612
Fixed plugin generation issues #612
Conversation
d61089e
to
6daa446
Compare
6daa446
to
3bed0ab
Compare
…plugin into fix-plugin-generation
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.
Thank you for these fixes.
Could you please review my failed test cases?
Case 1
public function catchException(Bootstrap $bootstrap, \Exception $exception)
{
return false;
}
As result, we have \Exception
as param type, which is already added to use
list. It is reproducible for all plugin types.
/**
* @param UserConfig $subject
* @param Bootstrap $bootstrap
* @param Exception $exception
* @return array
*/
public function beforeCatchException(UserConfig $subject, Bootstrap $bootstrap, \Exception $exception): array
{
// TODO: Implement plugin method.
return [$bootstrap, $exception];
}
Case 2
After and Around generations result in missing strict returning type. I believe we can also add the return type if is known from the method's docs.
/**
* @param BackendApp $subject
* @param callable $proceed
*/
public function aroundGetCookiePath(BackendApp $subject, callable $proceed):
{
// TODO: Implement plugin method.
return $proceed();
}
addcbcc
to
de85f20
Compare
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.
Thank you for fixing the previous issues. Please find out the following test case that I could find out.
Case 1
For After/Around plugins
/**
* @return \Magento\Framework\DB\Select
*/
public function getSelectCountSql()
{
/* @var $countSelect \Magento\Framework\DB\Select */
$countSelect = parent::getSelectCountSql();
$countSelect->resetJoinLeft();
return $countSelect;
}
Results in not adding the Select class to use
section. The same happens with imported method's params.
/**
* @param Collection $subject
* @param Select $result
* @return Select
*/
public function afterGetSelectCountSql(Collection $subject, Select $result): Select
{
// TODO: Implement plugin method.
return $result;
}
Hello, @eduard13 I've successfully reproduced your last case: Could you please check if everything is fine now? I created a test class for this, I could miss something. Thanks, Bohdan |
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.
Thank you for the great effort on this one 👏
Description (*)
I've prettified the plugin generation feature.
What was done:
Fixed Issues (if relevant)
Contribution checklist (*)