1 | <?php |
||
13 | class GithubApi |
||
14 | { |
||
15 | /** |
||
16 | * Github username |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $username; |
||
20 | |||
21 | 5 | public function __construct($username = null) |
|
22 | { |
||
23 | 5 | $this->username = $username; |
|
24 | 5 | if (is_null($username)) { |
|
25 | 1 | throw new EvangelizeException("You have to pass in a username, Username cannot be null", 1); |
|
26 | } |
||
27 | 5 | } |
|
28 | |||
29 | /** |
||
30 | * Get username passed as the parameter |
||
31 | * @return string |
||
32 | */ |
||
33 | 1 | public function getUsername() |
|
37 | |||
38 | /** |
||
39 | * Return an integer representing number of public repos |
||
40 | * the username provided has on github |
||
41 | * @return int |
||
42 | */ |
||
43 | 2 | public function getRepos() |
|
56 | |||
57 | } |