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 SlackServiceProviderLaravel5 extends ServiceProvider |
||
9 | { |
||
10 | /** |
||
11 | * Bootstrap the application events. |
||
12 | * |
||
13 | * @return void |
||
14 | */ |
||
15 | public function boot() |
||
16 | { |
||
17 | $this->publishes([__DIR__.'/config/config.php' => config_path('slack.php')]); |
||
18 | } |
||
19 | |||
20 | /** |
||
21 | * Register the service provider. |
||
22 | * |
||
23 | * @return void |
||
24 | */ |
||
25 | public function register() |
||
26 | { |
||
27 | $this->mergeConfigFrom(__DIR__.'/config/config.php', 'slack'); |
||
28 | |||
29 | $this->app['maknz.slack'] = $this->app->share(function ($app) { |
||
30 | return new Client( |
||
31 | $app['config']->get('slack.endpoint'), |
||
32 | [ |
||
33 | 'channel' => $app['config']->get('slack.channel'), |
||
34 | 'username' => $app['config']->get('slack.username'), |
||
35 | 'icon' => $app['config']->get('slack.icon'), |
||
36 | 'link_names' => $app['config']->get('slack.link_names'), |
||
37 | 'unfurl_links' => $app['config']->get('slack.unfurl_links'), |
||
38 | 'unfurl_media' => $app['config']->get('slack.unfurl_media'), |
||
39 | 'allow_markdown' => $app['config']->get('slack.allow_markdown'), |
||
40 | 'markdown_in_attachments' => $app['config']->get('slack.markdown_in_attachments'), |
||
41 | ], |
||
42 | new Guzzle |
||
43 | ); |
||
44 | }); |
||
45 | |||
46 | $this->app->bind('Maknz\Slack\Client', 'maknz.slack'); |
||
0 ignored issues
–
show
|
|||
47 | } |
||
48 | } |
||
49 |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.