bug PR-4.4-dev b/c break PR-5.2-dev Pending

User tests: Successful: Unsuccessful:

avatar heelc29
heelc29
3 Jan 2024

Summary of Changes

return type of send() function between class and interface do not match

class: boolean

/**
* Send the mail
*
* @return boolean Boolean true if successful, false if exception throwing is disabled.
*
* @since 1.7.0
*
* @throws MailDisabledException if the mail function is disabled
* @throws phpmailerException if sending failed
*/
public function Send()

interface: void

/**
* Send the mail. Throws an exception when something goes wrong.
*
* @return void
*
* @since 4.4.0
*
* @throws \RuntimeException
*/
public function send();

class contains return statement:

return $result;

Testing Instructions

code review

Actual result BEFORE applying this Pull Request

phan warning:
libraries/src/Mail/Mail.php:134 PhanParamSignatureMismatch Declaration of function Send() : bool should be compatible with function send() : void defined in libraries/src/Mail/MailerInterface.php:32

Expected result AFTER applying this Pull Request

return type of class and interface match (warning in phan disappear)

Link to documentations

Please select:

  • No documentation changes for docs.joomla.org needed
  • No documentation changes for manual.joomla.org needed
avatar heelc29 heelc29 - open - 3 Jan 2024
avatar heelc29 heelc29 - change - 3 Jan 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 3 Jan 2024
Category Libraries
avatar heelc29 heelc29 - change - 28 Jan 2024
Labels Added: PR-4.4-dev
avatar HLeithner
HLeithner - comment - 24 Apr 2024

Changing the interface is a b/c break but Implemented code says it returns a boolean... @laoneo @MacJoom what would you like to do? move to 6.0? or merge to 4.4?

avatar heelc29
heelc29 - comment - 1 Sep 2024

In my opinion this is a docblock error introduced with 4.4 (#40560) so it should be a bugfix against 4.4

avatar heelc29 heelc29 - change - 1 Sep 2024
Labels Added: bug b/c break
avatar HLeithner
HLeithner - comment - 15 Nov 2024

This pull request has been automatically rebased to 5.2-dev.

avatar HLeithner HLeithner - change - 15 Nov 2024
Title
[4.4] fix return type in phpdoc
[5.2] fix return type in phpdoc
avatar HLeithner HLeithner - edited - 15 Nov 2024
avatar heelc29 heelc29 - change - 2 Dec 2024
Labels Added: PR-5.2-dev
avatar laoneo
laoneo - comment - 2 Dec 2024

Sorry,missed this. Correctly the send function should return nothing and only throw an exception when something fails.

avatar heelc29
heelc29 - comment - 19 Jan 2025

So libraries/src/Mail/Mail.php should be updated? Is there a b/c break free option?

Add a Comment

Login with GitHub to post a comment