Conditions | 5 |
Paths | 7 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5.9256 |
Changes | 0 |
1 | <?php |
||
26 | 127 | public function notify(TestResult $result) |
|
27 | { |
||
28 | 127 | if ($this->config['enabled'] === false) { |
|
29 | 127 | return; |
|
30 | } |
||
31 | |||
32 | 1 | if ($this->twilio === null) { |
|
33 | $this->twilio = new \Services_Twilio( |
||
34 | $this->config['twilio_account_sid'], |
||
35 | $this->config['twilio_auth_token'] |
||
36 | ); |
||
37 | } |
||
38 | |||
39 | 1 | foreach ($result->getTest()->getGroup()->getUsers() as $user) { |
|
40 | 1 | if ($user->shouldBeAlerted($result)) { |
|
41 | 1 | $this->sendSms($result, $user); |
|
42 | 1 | } |
|
43 | 1 | } |
|
44 | 1 | } |
|
45 | |||
62 |