Skip to content
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

Wrong phpDoc for AbstractProtocol::_expect #161

Open
rarog opened this issue Aug 2, 2021 · 2 comments
Open

Wrong phpDoc for AbstractProtocol::_expect #161

rarog opened this issue Aug 2, 2021 · 2 comments
Labels
Bug Something isn't working

Comments

@rarog
Copy link

rarog commented Aug 2, 2021

Bug Report

Q A
Version(s) 2.14.1

Summary

The phpDoc suggests string|array as type of parameter $code, while all calls are int or array of int

Current behavior

All calls of _expect are done with int or array of int. This is then implicitly converted by call of in_array without $strict parameter with previously processed string via preg_split, which means $strict = false and implicit conversion. This is confusing and inconsistent in terms of clean code.

Expected behavior

Either suggest int codes that will be converted to string explicitly or use calls with actual string parameters.

@rarog rarog added the Bug Something isn't working label Aug 2, 2021
@Ocramius
Copy link
Member

Ocramius commented Aug 2, 2021

Could you point to a code fragment (absolute URI) please?

@froschdesign
Copy link
Member

/**
* Parse server response for successful codes
*
* Read the response from the stream and check for expected return code.
* Throws a Laminas\Mail\Protocol\Exception\ExceptionInterface if an unexpected code is returned.
*
* @param string|array $code One or more codes that indicate a successful response
* @param int $timeout Per-request timeout value if applicable
* @throws Exception\RuntimeException
* @return string Last line of response string
*/
protected function _expect($code, $timeout = null)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants