Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
55 | public function processChannelCreated(array $data) |
||
|
|||
56 | { |
||
57 | $channel = $data['channel']; |
||
58 | $message = new Message(); |
||
59 | $message->setText(sprintf( |
||
60 | '<@%s> open channel #%s, join it <#%s>', |
||
61 | $channel['creator'], |
||
62 | $channel['name'], |
||
63 | $channel['id'] |
||
64 | )); |
||
65 | $this->sendResponse($message, null, $GLOBALS['config']['slack']['channels']['channelCreated']); |
||
66 | } |
||
67 | } |
||
68 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: