-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
Add string type declarations to global API functions. #15864
Conversation
(Standard links)
|
Yup, makes sense to me. 👍 (Tangent: One might be reserved about filling-in signatures generally - e.g. one might say |
The v3 API explicitly checks if params is an array, not just iterable. The v4 API might work with iterable though? I didn't try this |
Looks like we can't use iterable as a type declaration until PHP 7.1 is the minimum version. |
test this please |
For the The weird
It feels like this might be some weird/quirky thing specific to this change. I can't see any other/similar timeouts among recent PR tests. The timeout happened in the same spot in both runs. (Background: The timeout policy is this: if the build-job doesn't produce any console output for 60m, then it aborts. So in both cases, it spent 60m with no output after Let's give it one more test-run to rule out some fluke in the execution... |
jenkins, test this please |
da6f2ab
to
b9cb949
Compare
b9cb949
to
8f76fa8
Compare
Various tests assume civicrm_api() $entity param is nullable, so rather than rewriting the tests and/or internal API code, I decided to leave this assumption intact for now. |
We should probably rip out those tests now. However, I'm OK to merge this now it's passing |
Overview
As of PHP 7 we can add
string
type declarations.Before
These functions have only type hints for the first two params.
After
The string params are also enforced via type declarations.