Closed
Description
Preconditions (*)
Magento 2.3.3
Steps to reproduce (*)
>>> $address = new \Magento\Framework\Mail\Address(null, null);
=> Magento\Framework\Mail\Address {#17559}
>>> $address->getName();
=> null
>>> $address->getEmail();
TypeError: Return value of Magento/Framework/Mail/Address::getEmail() must be of the type string, null returned
Expected result (*)
Either one of:
- Instantiating the
\Magento\Framework\Mail\Address
class with anull
value in the email parameter should not be possible, or; - the
getEmail
method's return type should be nullable, the same as the constructor argument (?string
)
Actual result (*)
Instantiating the Address class with a null
email address is possible which will always cause the getEmail method to throw an exception as it's only allowed to return string
values
TypeError: Return value of Magento/Framework/Mail/Address::getEmail() must be of the type string, null returned
Metadata
Metadata
Assignees
Labels
The issue has been fixed in 2.3 release lineGate 2 Passed. Manual verification of the issue description passedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentThe issue has been reproduced on latest 2.3 release