The "$params" or "$options" method parameter name
Right now some methods of the Api class use the $params parameter (6 methods) and some use the $options parameter (2 methods) for specifying extra parameters for the upcoming Jira API call.
I think we need to use consistent naming because the parameter meanings for API calls are identical.
What do you prefer?
// cc: @chobie, @jpastoor, @glensc
examples!
for this one, params is correct:
return $this->api(self::REQUEST_PUT, sprintf('/rest/api/2/issue/%s', $issue_key), $params);
altho api method it's $data:
- https://github.com/console-helpers/jira-api-restclient/blob/a8986ac2128ad7e92294bbf741328f65ae92cde8/src/Jira/Api.php#L762
@glensc , what about other methods using $params and $options?
I'm on the fence here, because:
- what usually is specified in
$paramsgoes into the json-encodedRequest bodypart (according to the API docs) so they are parameters of the API call - the
$optionsare optional stuff and indeed every API call implemented can work without specifying these
So they're options and params at the same time.
The $data variable name is from library conception times. Not sure what @chobie meant with this name. Probably an abstract name to represent a data, that goes into the request.