Skip to content

fix for Issue #25434 Mail address email constructor argument type inc… #25485

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

karyna-t
Copy link
Contributor

@karyna-t karyna-t commented Nov 6, 2019

Description (*)

fix for Issue #25434 Mail address email constructor argument type incorrect

Fixed Issues (if relevant)

  1. Mail address email constructor argument type incorrect #25434: Mail address email constructor argument type incorrect

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 are green)

@karyna-t karyna-t requested a review from melnikovi as a code owner November 6, 2019 09:31
@m2-assistant
Copy link

m2-assistant bot commented Nov 6, 2019

Hi @karyna-tsymbal-atwix. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@magento-engcom-team magento-engcom-team added Component: Mail Release Line: 2.3 Partner: Atwix Pull Request is created by partner Atwix partners-contribution Pull Request is created by Magento Partner labels Nov 6, 2019
@rogyar rogyar self-assigned this Nov 6, 2019
@@ -29,7 +29,7 @@ class Address
* @param string|null $name
*/
public function __construct(
?string $email,
string $email,
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest changing the getEmail() method instead of changing the constructor parameters. So we have the constructor untouched but

public function getEmail(): ?string

This solution will be more consistent considering the same approach in getName() method.

Thank you

@rogyar
Copy link
Contributor

rogyar commented Nov 6, 2019

Also, after the proposed change, could you cover this case with a unit test, please? The test will instantiate the object with no email and invoke getEmail() method. Then it will assert that no exception is being thrown.

Thank you!

@rogyar rogyar added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Nov 6, 2019
@rogyar
Copy link
Contributor

rogyar commented Nov 6, 2019

For QA
We can consider this change as "slightly" backward-incompatible since we are changing the public method signature. However, this change is necessary since it fixes a pretty critical issue

@magento-engcom-team
Copy link
Contributor

Hi @rogyar, thank you for the review.
ENGCOM-6240 has been created to process this Pull Request

@engcom-Bravo
Copy link
Contributor

✔️ QA Passed

magento-engcom-team pushed a commit that referenced this pull request Nov 14, 2019
@magento-engcom-team magento-engcom-team merged commit d40fbd9 into magento:2.3-develop Nov 14, 2019
@m2-assistant
Copy link

m2-assistant bot commented Nov 14, 2019

Hi @karyna-tsymbal-atwix, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@magento-engcom-team magento-engcom-team added this to the Release: 2.3.5 milestone Nov 14, 2019
@karyna-t karyna-t deleted the fix-mail-address-constructor-argument-type-incorrect branch August 6, 2021 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: bug fix Component: Mail Partner: Atwix Pull Request is created by partner Atwix partners-contribution Pull Request is created by Magento Partner Progress: accept Release Line: 2.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants