Skip to content

[Backport] Improve code quality subscriber new action#18433

Merged
magento-engcom-team merged 1 commit intomagento:2.2-developfrom
lewisvoncken:2.2-develop-PR-port-17232
Oct 8, 2018
Merged

[Backport] Improve code quality subscriber new action#18433
magento-engcom-team merged 1 commit intomagento:2.2-developfrom
lewisvoncken:2.2-develop-PR-port-17232

Conversation

@lewisvoncken
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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