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

Abstract duplicate code to retrieve a download url #373

Merged
merged 2 commits into from
Apr 28, 2015

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Apr 28, 2015

No description provided.

@jrfnl jrfnl added this to the 2.5.0 milestone Apr 28, 2015
* @return string Plugin download URL or path to local file
*/
public function get_download_url( $slug ) {
$dl = '';
Copy link
Member

Choose a reason for hiding this comment

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

Scrutinizer will likely pick up on this as being too short a variable name. $download_url or $url would be a little more descriptive.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm.. but $url would be wrong as it can be a path just as easily... which is why I went with $dl ;-)

Copy link
Member

Choose a reason for hiding this comment

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

Then the function name is misleading too :-)

- return early
- variable name > 2 chars
- update documentation
@jrfnl
Copy link
Contributor Author

jrfnl commented Apr 28, 2015

Updated the PR

GaryJones added a commit that referenced this pull request Apr 28, 2015
…oad-url

Abstract duplicate code to retrieve a download url
@GaryJones GaryJones merged commit fe5fa91 into develop Apr 28, 2015
@GaryJones GaryJones deleted the feature/abstract-get-download-url branch April 28, 2015 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants