Strict DiscoveryService#7899
Merged
Merged
Conversation
* Made strict * Type hints * Return types Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
ChristophWurst
approved these changes
Jan 16, 2018
juliusknorr
previously requested changes
Jan 16, 2018
| public function discover(string $remote, string $service): array { | ||
| // Check the cache first | ||
| $cacheData = $this->cache->get($remote . '#' . $service); | ||
| if($cacheData) { |
Member
There was a problem hiding this comment.
Regarding the next line, maybe we should add a check here since json_decode might be null which will then cause a type error.
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
|
Member
|
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>
juliusknorr
approved these changes
Jan 16, 2018
MorrisJobke
approved these changes
Jan 17, 2018
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Roeland Jago Douma roeland@famdouma.nl