-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add more precise type info for stubs #6005
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
Conversation
ecb3b00
to
37df2f8
Compare
37df2f8
to
2e0f388
Compare
@@ -227,7 +226,7 @@ function numfmt_parse_currency(NumberFormatter $fmt, string $value, &$currency, | |||
/** @param int|float $value */ | |||
function numfmt_set_attribute(NumberFormatter $fmt, int $attr, $value): bool {} | |||
|
|||
function numfmt_get_attribute(NumberFormatter $fmt, int $attr): int|double|false {} | |||
function numfmt_get_attribute(NumberFormatter $fmt, int $attr): int|float|false {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ouch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should check against this in gen_stub?
62102b4
to
90da7d4
Compare
9bc84f1
to
c74a8fe
Compare
@@ -227,7 +226,7 @@ function numfmt_parse_currency(NumberFormatter $fmt, string $value, &$currency, | |||
/** @param int|float $value */ | |||
function numfmt_set_attribute(NumberFormatter $fmt, int $attr, $value): bool {} | |||
|
|||
function numfmt_get_attribute(NumberFormatter $fmt, int $attr): int|double|false {} | |||
function numfmt_get_attribute(NumberFormatter $fmt, int $attr): int|float|false {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should check against this in gen_stub?
Z_PARAM_ZVAL(value) | ||
Z_PARAM_OPTIONAL | ||
Z_PARAM_LONG(timeout) | ||
Z_PARAM_LONG(retries) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
omfg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I had a similar feeling when migrating this code to the new ZPP :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the docs (emphasis mine): "snmp3_set() is used to set the value of an SNMP object specified by the object_id."
@@ -57,20 +47,19 @@ public function getIteratorMode() {} | |||
public function offsetExists($index) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wanted to say that these should have an int
type now, but ... gah, we can't :(
5723b49
to
b8598af
Compare
This PR tries to move a bunch of type info from PHPDoc to actual declaration, while fixing a few related things.
After this PR, most of the type info will be added as a declaration, except for:
resource
types, which we shouldn't worry aboutarray|string
,array|string|null
andarray|string|int
typesarray|int
typesstring|int
typesGMP|int|bool|string
types in ext/gmpcallable
types in ext/session and ext/xmlcallable|int
,scalar
, types where multiple classes are involved