1 | <?php |
||
23 | class EvangelistStatus implements EvangelistStatusInterface |
||
24 | { |
||
25 | protected $githubApi; |
||
26 | private $username; |
||
27 | private $response; |
||
28 | private $clientId; |
||
29 | private $clientSecret; |
||
30 | private $guzzleClient; |
||
31 | private $githubResponse; |
||
32 | private $noOfGitRepos; |
||
33 | |||
34 | public function __construct($username) |
||
55 | |||
56 | /** |
||
57 | * This method returns Github JSON data |
||
58 | * @param void |
||
59 | * @return response |
||
60 | */ |
||
61 | public function getGitApiData() |
||
66 | |||
67 | /** |
||
68 | * This method returns number of the user repo on Github |
||
69 | * @param void |
||
70 | * @return public_repos |
||
71 | */ |
||
72 | public function getNumberOfRepos() |
||
83 | |||
84 | /** |
||
85 | * This method returns a string depending on number of user repositories on Github |
||
86 | * @param void |
||
87 | * @return string evangelistRanking |
||
88 | */ |
||
89 | public function getStatus() |
||
93 | |||
94 | /** |
||
95 | * This method checks for empty GitHub username |
||
96 | * @param string $username |
||
97 | * @return boolean |
||
98 | */ |
||
99 | public function checkEmptyGithubUsername($username) |
||
107 | |||
108 | /** |
||
109 | * This method checks for null argument |
||
110 | * @return exception |
||
111 | */ |
||
112 | public function checkNullUsernameException() |
||
119 | } |
||
120 |
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.