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

fix(php): TProtocol::skip fix parameter type #2983

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/php/lib/Protocol/TProtocol.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ abstract public function readString(&$str);
* The skip function is a utility to parse over unrecognized date without
* causing corruption.
*
* @param TType $type What type is it
* @param int $type What type is it
Copy link
Contributor

Choose a reason for hiding this comment

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

@param int $type What type is it (defined in TType::class)

Copy link
Member

Choose a reason for hiding this comment

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

@sveneld I'm not sure what your comment implies? Also I don't understand the patch.

Copy link
Contributor

Choose a reason for hiding this comment

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

Before PHP7 phpdoc was used for defining types in php. This docblock is just for code understanding. Based on this doc block IDE give a suggestions for argument. TType is not a possible type for argument which will come to this method, integer value will come. That's why @rtm-ctrlz offer to write a real type of this function. And I suggest to add comment where the possible values is defined.

When I will return to my plan of migrating thrift to php7 with type declaration i will update this code.

*/
public function skip($type)
{
Expand Down