Conditions | 3 |
Paths | 2 |
Total Lines | 25 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 6.28 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
35 | 1 | public function boot() |
|
36 | { |
||
37 | /** @var Container $container */ |
||
38 | 1 | $container = $this->getContainer(); |
|
39 | |||
40 | 1 | if (!$container->get('SLACK_WEBHOOK_URL') || !$container->get('SLACK_CHANNEL')) { |
|
41 | 1 | return; |
|
42 | } |
||
43 | |||
44 | $container->share(Client::class) |
||
45 | ->addArguments([ |
||
46 | 'SLACK_WEBHOOK_URL', |
||
47 | [ |
||
48 | 'username' => 'Friendly Merge Reminder', |
||
49 | 'icon' => ':owl:', |
||
50 | 'channel' => $container->get('SLACK_CHANNEL'), |
||
51 | 'allow_markdown' => true, |
||
52 | ], |
||
53 | ]); |
||
54 | |||
55 | $container->share(SlackService::class) |
||
56 | ->addArgument(Client::class); |
||
57 | |||
58 | $container->inflector(SlackServiceAwareInterface::class) |
||
59 | ->invokeMethod('setSlackService', [SlackService::class]); |
||
60 | } |
||
62 |