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

The "$params" or "$options" method parameter name #218

Open
aik099 opened this issue Dec 31, 2024 · 2 comments
Open

The "$params" or "$options" method parameter name #218

aik099 opened this issue Dec 31, 2024 · 2 comments
Milestone

Comments

@aik099
Copy link
Member

aik099 commented Dec 31, 2024

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

@glensc
Copy link
Contributor

glensc commented Jan 1, 2025

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:

@aik099
Copy link
Member Author

aik099 commented Jan 1, 2025

@glensc , what about other methods using $params and $options?

I'm on the fence here, because:

  • what usually is specified in $params goes into the json-encoded Request body part (according to the API docs) so they are parameters of the API call
  • the $options are 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.

@aik099 aik099 added this to the v2.0.1 milestone Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants