Skip to content

Instantly share code, notes, and snippets.

@unicodeveloper
Last active September 30, 2015 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save unicodeveloper/d7df0b986402a7410dbc to your computer and use it in GitHub Desktop.
Save unicodeveloper/d7df0b986402a7410dbc to your computer and use it in GitHub Desktop.
Improper naming of functions
function names should start with a small letter
FetchGitData.php
Don’t commit private credentials. Load them from environment variables.
In function fetchData
Abstract line 28 to 34 into a function and just call it in function fetchData
It is cleaner that way
Don’t set the user agent to Mozilla, It should be something neutral. I mean, personally i don’t use Mozilla
getNoOfRepos function
$raw variable doesn’t really say much about that variable.. Rename it to something much more appropriate
line 55 could have just been return $raw[‘public_repos’]; instead of declaring an extra variable
ProcessGitData.php
From line 21 to 27
The conditions for the repos are not well checked.
There should be a range
Something like $noOfRepos >=5 && $noOfRepos <= 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment