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

NEW Init externalModules Class to Fetch Modules from Multiple Sources #33156

Merged
merged 11 commits into from
Feb 21, 2025

Conversation

Daoud-mohamed
Copy link
Contributor

This PR initializes the externalModules class to fetch modules from multiple sources and adapts it to the new Dolistore API

if (!isset($a[$key]) || !isset($b[$key])) {
return 0;
}
/** @var array<string, mixed> $a */
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to define these as parameters of a function, just before function.

return
  /**
   * @param ...
   * @param ...
   * @return 
   */
   function()...

$error_message = $error_messages[$request['status_code']] ?? 'Unexpected HTTP status: ' . $request['status_code'];

// Append error details if available
if (!empty($request['response']) && isset($request['response']['errors']) && is_array($request['response']['errors'])) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It is indicated that 'response' is a string. So to fix that you need to suggest it is response:?array{errors:string[]} or response:null|string|array{errors:string[]} if it can also be a string.

@Daoud-mohamed
Copy link
Contributor Author

Thanks @mdeweerd !

@eldy eldy merged commit 14e8655 into Dolibarr:develop Feb 21, 2025
7 checks passed
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.

3 participants