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

[0.4] Code modernization #63

Open
wants to merge 1 commit into
base: v0.4
Choose a base branch
from

Conversation

mbabker
Copy link

@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
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.

@@ -294,7 +294,7 @@ static function (Frame $frame): void {},
false,
null,
0,
0x8000000000000000
-1
Copy link
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
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.

2 participants