Skip to content

Conversation

@mbabker
Copy link
Contributor

@mbabker mbabker commented Dec 13, 2021

Closes #51

  • Adds parameter and return type declarations to method signatures where able
  • Adds parameter types to class properties
  • Adds visibility to all class methods and constants

@mbabker mbabker changed the title Code modernization [0.4] Code modernization Dec 13, 2021
* @todo Write logic for this method. See section 4.2.1.8
*/
public function verifyProtocol($val) {
public function verifyProtocol($val): bool {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Assuming this and verifyExtensions will also have boolean returns when implemented. So, adding them in now to avoid the theoretical B/C break later by changing the return type from void to bool.

null,
0,
0x8000000000000000
-1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

At least on my system, 0x8000000000000000 results in a float that fails the type check for this param (int|null). Since the class also rejects negative numbers, I changed the test to cover that condition since the engine will cover the non-integer case.

@cboden cboden added this to the 0.4 milestone Dec 13, 2021
@mbonneau mbonneau merged commit 2aedfd2 into ratchetphp:v0.4 Dec 5, 2024
@mbabker mbabker deleted the code-modernization branch December 5, 2024 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants