-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Strict DiscoveryService #7899
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
Strict DiscoveryService #7899
Conversation
* Made strict * Type hints * Return types Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
| public function discover(string $remote, string $service): array { | ||
| // Check the cache first | ||
| $cacheData = $this->cache->get($remote . '#' . $service); | ||
| if($cacheData) { |
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.
Regarding the next line, maybe we should add a check here since json_decode might be null which will then cause a type error.
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.
Sounds sane I'll add it
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.
Done
Codecov Report
@@ Coverage Diff @@
## master #7899 +/- ##
=============================================
+ Coverage 6.63% 51.12% +44.49%
- Complexity 24930 24992 +62
=============================================
Files 1604 1604
Lines 94988 95165 +177
Branches 1376 1376
=============================================
+ Hits 6302 48657 +42355
+ Misses 88686 46508 -42178
|
|
ref (#7392) |
json_decode can return false if we have invalid data. In that case just assume there was nothing cached Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma roeland@famdouma.nl