Skip to content

PHPC-2004: Use tentative return types for BSON interface toString methods #1283

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

Merged
merged 1 commit into from
Dec 14, 2021
Merged
Show file tree
Hide file tree
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 src/BSON/BinaryInterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ zend_class_entry* php_phongo_binary_interface_ce;

/* {{{ MongoDB\BSON\BinaryInterface function entries */
/* clang-format off */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(ai_BinaryInterface___toString, 0, 0, IS_STRING, 0)
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(ai_BinaryInterface___toString, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(ai_BinaryInterface_void, 0, 0, 0)
Expand Down
2 changes: 1 addition & 1 deletion src/BSON/Decimal128Interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ zend_class_entry* php_phongo_decimal128_interface_ce;

/* {{{ MongoDB\BSON\Decimal128Interface function entries */
/* clang-format off */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(ai_Decimal128Interface___toString, 0, 0, IS_STRING, 0)
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(ai_Decimal128Interface___toString, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()

static zend_function_entry php_phongo_decimal128_interface_me[] = {
Expand Down
2 changes: 1 addition & 1 deletion src/BSON/JavascriptInterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ zend_class_entry* php_phongo_javascript_interface_ce;

/* {{{ MongoDB\BSON\JavascriptInterface function entries */
/* clang-format off */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(ai_JavascriptInterface___toString, 0, 0, IS_STRING, 0)
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(ai_JavascriptInterface___toString, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(ai_JavascriptInterface_void, 0, 0, 0)
Expand Down
2 changes: 1 addition & 1 deletion src/BSON/ObjectIdInterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ zend_class_entry* php_phongo_objectid_interface_ce;

/* {{{ MongoDB\BSON\ObjectIdInterface function entries */
/* clang-format off */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(ai_ObjectIdInterface___toString, 0, 0, IS_STRING, 0)
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(ai_ObjectIdInterface___toString, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(ai_ObjectIdInterface_void, 0, 0, 0)
Expand Down
2 changes: 1 addition & 1 deletion src/BSON/RegexInterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ zend_class_entry* php_phongo_regex_interface_ce;

/* {{{ MongoDB\BSON\RegexInterface function entries */
/* clang-format off */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(ai_RegexInterface___toString, 0, 0, IS_STRING, 0)
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(ai_RegexInterface___toString, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(ai_RegexInterface_void, 0, 0, 0)
Expand Down
2 changes: 1 addition & 1 deletion src/BSON/TimestampInterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ zend_class_entry* php_phongo_timestamp_interface_ce;

/* {{{ MongoDB\BSON\TimestampInterface function entries */
/* clang-format off */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(ai_TimestampInterface___toString, 0, 0, IS_STRING, 0)
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(ai_TimestampInterface___toString, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(ai_TimestampInterface_void, 0, 0, 0)
Expand Down
2 changes: 1 addition & 1 deletion src/BSON/UTCDateTimeInterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ zend_class_entry* php_phongo_utcdatetime_interface_ce;

/* {{{ MongoDB\BSON\UTCDateTimeInterface function entries */
/* clang-format off */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(ai_UTCDateTimeInterface___toString, 0, 0, IS_STRING, 0)
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(ai_UTCDateTimeInterface___toString, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(ai_UTCDateTimeInterface_void, 0, 0, 0)
Expand Down
2 changes: 1 addition & 1 deletion tests/session/session-advanceOperationTime-003.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MyTimestamp implements MongoDB\BSON\TimestampInterface
return 1234;
}

public function __toString(): string
public function __toString()
{
return sprintf('[%d:%d]', $this->getIncrement(), $this->getTimestamp());
}
Expand Down
2 changes: 1 addition & 1 deletion tests/session/session-advanceOperationTime_error-001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class MyTimestamp implements MongoDB\BSON\TimestampInterface
return 1234;
}

public function __toString(): string
public function __toString()
{
return sprintf('[%d:%d]', $this->getIncrement(), $this->getTimestamp());
}
Expand Down