Skip to content
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

ENH Work with official list of supported modules #191

Conversation

emteknetnz
Copy link
Collaborator

Copy link
Collaborator

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the PHPDoc for the ApiLoader class - it says "Handles fetching supported addon details from addons.silverstripe.org" but that's not where we're fetching the data from.
Also update phpdoc for doRequest() - this method doesn't seem to have anything to do with checking "module health"?

Also given that we're touching the error messaging here, we should update the "response could not be parsed" error

if (empty($responseJson)) {
-    throw new RuntimeException($failureMessage . 'Response could not be parsed');
+    if (json_last_error() !== JSON_ERROR_NONE) {
+        throw new RuntimeException($failureMessage . json_last_error_msg());
+    }
+    throw new RuntimeException($failureMessage . 'Response was empty');
}

Make sure to add testing for both of these failure scenarios.

src/Util/SupportedAddonsLoader.php Show resolved Hide resolved
src/Util/ApiLoader.php Outdated Show resolved Hide resolved
@emteknetnz emteknetnz force-pushed the pulls/3.0/installed-modules branch from f117862 to 9b2d015 Compare March 13, 2023 03:01
src/Util/ApiLoader.php Outdated Show resolved Hide resolved
@emteknetnz emteknetnz force-pushed the pulls/3.0/installed-modules branch from 9b2d015 to ec027ab Compare March 14, 2023 21:49
@GuySartorelli GuySartorelli merged commit d4ac99e into bringyourownideas:3.0 Mar 14, 2023
@GuySartorelli GuySartorelli deleted the pulls/3.0/installed-modules branch March 14, 2023 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants