These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Maknz\Slack; |
||
4 | |||
5 | use Illuminate\Support\ServiceProvider; |
||
6 | use GuzzleHttp\Client as Guzzle; |
||
7 | |||
8 | class SlackServiceProviderLaravel4 extends ServiceProvider |
||
9 | { |
||
10 | /** |
||
11 | * Bootstrap the application events. |
||
12 | * |
||
13 | * @return void |
||
14 | */ |
||
15 | public function boot() |
||
16 | { |
||
17 | $this->package('maknz/slack', null, __DIR__); |
||
18 | } |
||
19 | |||
20 | /** |
||
21 | * Register the service provider. |
||
22 | * |
||
23 | * @return void |
||
24 | */ |
||
25 | public function register() |
||
26 | { |
||
27 | $this->app['maknz.slack'] = $this->app->share(function ($app) { |
||
28 | $allow_markdown = $app['config']->get('slack::allow_markdown'); |
||
29 | |||
30 | $markdown_in_attachments = $app['config']->get('slack::markdown_in_attachments'); |
||
31 | |||
32 | $unfurl_media = $app['config']->get('slack::unfurl_media'); |
||
33 | |||
34 | return new Client( |
||
35 | $app['config']->get('slack::endpoint'), |
||
36 | [ |
||
37 | 'channel' => $app['config']->get('slack::channel'), |
||
38 | 'username' => $app['config']->get('slack::username'), |
||
39 | 'icon' => $app['config']->get('slack::icon'), |
||
40 | 'link_names' => $app['config']->get('slack::link_names'), |
||
41 | 'unfurl_links' => $app['config']->get('slack::unfurl_links'), |
||
42 | 'unfurl_media' => is_bool($unfurl_media) ? $unfurl_media : true, |
||
43 | 'allow_markdown' => is_bool($allow_markdown) ? $allow_markdown : true, |
||
44 | 'markdown_in_attachments' => is_array($markdown_in_attachments) ? $markdown_in_attachments : [], |
||
45 | ], |
||
46 | new Guzzle |
||
47 | ); |
||
48 | }); |
||
49 | |||
50 | $this->app->bind('Maknz\Slack\Client', 'maknz.slack'); |
||
0 ignored issues
–
show
|
|||
51 | } |
||
52 | } |
||
53 |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.