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

Reduce complexity in LtiServiceConnector::getAll() #128

Merged
merged 2 commits into from
Jan 3, 2024

Conversation

dbhynds
Copy link
Member

@dbhynds dbhynds commented Dec 21, 2023

Summary of Changes

Code Climate flagged this up, and I saw some opportunities to simplify it.

Testing

  • I have added automated tests for my changes
  • I ran composer test before opening this PR
  • I ran composer lint-fix before opening this PR

@dbhynds dbhynds requested a review from lin-brian-l December 21, 2023 23:13
@dbhynds dbhynds mentioned this pull request Jan 2, 2024
3 tasks
Copy link

@lin-brian-l lin-brian-l left a comment

Choose a reason for hiding this comment

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

@dbhynds I just have a quick request, but this looks good to me!

Comment on lines 168 to 169
if (isset($key)) {
$page_results = $response['body'][$key] ?? [];
} else {
$page_results = $response['body'] ?? [];
}

$page_results = $this->getResultsFromResponse($response, $key);
$results = array_merge($results, $page_results);

Choose a reason for hiding this comment

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

Can $page_results be made into camelCase?

@dbhynds dbhynds requested a review from lin-brian-l January 3, 2024 16:24
@dbhynds dbhynds merged commit f820c59 into v6.0-beta Jan 3, 2024
4 checks passed
@dbhynds dbhynds deleted the v6-cognitive-complexity branch January 3, 2024 16:49
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