Conditions | 5 |
Paths | 5 |
Total Lines | 14 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | public static function create($githubCommitStatusStateTest) |
||
19 | { |
||
20 | if ($githubCommitStatusStateTest === 'pending') { |
||
21 | return new GithubCommitStatusPendingState(); |
||
22 | } elseif ($githubCommitStatusStateTest === 'success') { |
||
23 | return new GithubCommitStatusSuccessState(); |
||
24 | } elseif ($githubCommitStatusStateTest === 'failure') { |
||
25 | return new GithubCommitStatusFailureState(); |
||
26 | } elseif ($githubCommitStatusStateTest === 'error') { |
||
27 | return new GithubCommitStatusErrorState(); |
||
28 | } |
||
29 | |||
30 | throw new Exception($githubCommitStatusStateTest.' is not recognized commit state'); |
||
31 | } |
||
32 | } |
||
33 |