-
Notifications
You must be signed in to change notification settings - Fork 123
Added client-side cache to Api::getResolutions #131
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
Added client-side cache to Api::getResolutions #131
Conversation
…ocblock. Added unittest.
src/Jira/Api.php
Outdated
| $result = $this->api(self::REQUEST_GET, '/rest/api/2/resolution', array()); | ||
|
|
||
| foreach ( $result->getResult() as $k => $v ) { | ||
| $resolutions[$v['id']] = $v; |
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.
Please do this:
- remove
$kvariable, because array key isn't being used - rename
$vvariable into$resolution_data - instead of doing
$result->getResult()here you can specify extra argument to the->api(call for it to return array directly back to you
Added unit tests for other local caches as well Made a helper function to clear the local caches when a new endpoint is selected
src/Jira/Api.php
Outdated
| * Client-side cache of Fields. | ||
| * | ||
| * @var array | ||
| * @var array|null List of fields when loaded, null when nothing is fetched yet |
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.
In multi-line notation of @var DocBlock the description should go in dedicated place (up). In single line @var DocBlock notation indeed the description would be written right after type name.
|
PR branch was deleted. Are you force pushing maybe? |
src/Jira/Api.php
Outdated
|
|
||
| /** | ||
| * Fields. | ||
| * Client-side cache of Fields. List of fields when loaded, null when nothing is fetched yet. |
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.
The Fields should be in lowercase. It was capitalized because it was 1st word in sentence.
src/Jira/Api.php
Outdated
|
|
||
| /** | ||
| * Statuses. | ||
| * Client-side cache of Statuses. List of statuses when loaded, null when nothing is fetched yet. |
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.
The Statuses should be in lowercase. It was capitalized because it was 1st word in sentence.
|
Code looks good. Just noticed, that
|
CHANGELOG.md
Outdated
| - Minimal supported PHP version changed from 5.2 to 5.3 by [@chobie]. | ||
| - The `Api::getPriorties` renamed into `Api::getPriorities` (former method kept for BC reasons) by [@josevh]. | ||
| - Remove trailing slash from endpoint url by [@Procta]. | ||
| - Clearing local caches (statuses, priorities, fields and resolutions) on endpoint change [@jpastoor]. |
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.
This is a bugfix (although nobody reported such bug) and needs to be moved to Fixes section.
|
Merging. Thanks, @jpastoor . |
Fixes #122