Skip to content

[Backport] Improve code quality subscriber new action #18433

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

Conversation

lewisvoncken
Copy link
Contributor

Original Pull Request

#17232

  • Refactor else block for returning success message to private function
  • Remove not thrown @thrown tag and add missing @thrown tag
  • Use import statements for classes
  • Because imports are being used an if statement can be written on one line
  • Use addExceptionMessage and addSuccessMessage instead of their deprecated counterparts

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

+ Refactor `else` block for returning success message to private function
+ Use import statements for classes
+ Because imports are being used an `if` statement can be written on one line
+ Use `addExceptionMessage` and `addSuccessMessage` instead of their deprecated counterparts
+ Include with DI the `Magento\Framework\Validator\EmailAddress` class
which can be used to validate the email address. Therefore the static
function call to the `is` method on the `Zend_Validate` class is not
needed anymore.
@magento-engcom-team
Copy link
Contributor

Hi @lewisvoncken. Thank you for your contribution.
We will aim to release these changes as part of 2.2.8.
Please check the release notes for final confirmation.

Please, consider to port this solution to 2.3 release line.
You may use Porting tool to port commits automatically.

1 similar comment
@magento-engcom-team
Copy link
Contributor

Hi @lewisvoncken. Thank you for your contribution.
We will aim to release these changes as part of 2.2.8.
Please check the release notes for final confirmation.

Please, consider to port this solution to 2.3 release line.
You may use Porting tool to port commits automatically.

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.

4 participants