Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
31 | protected function getPublicKey() |
||
32 | { |
||
33 | $config = file_get_contents($this->configSource); |
||
34 | |||
35 | if (!$config) { |
||
36 | throw new \UnexpectedValueException("Could not fetch the content from {$this->configSource}."); |
||
37 | } |
||
38 | |||
39 | $travisConfig = json_decode($config); |
||
40 | |||
41 | if (!$travisConfig) { |
||
42 | throw new \UnexpectedValueException("Configuration fetched from {$this->configSource} is not valid JSON."); |
||
43 | } |
||
44 | |||
45 | $publicKey = $travisConfig->config->notifications->webhook->public_key; |
||
46 | |||
47 | return $publicKey; |
||
48 | } |
||
49 | |||
55 |