GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#46)
by Regan
02:10
created

SlackServiceProviderLaravel5::register()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 4
Bugs 2 Features 0
Metric Value
c 4
b 2
f 0
dl 0
loc 23
rs 9.0856
cc 1
eloc 15
nc 1
nop 0
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
Bug introduced by
The method bind cannot be called on $this->app (of type array<string,?,{"maknz.slack":"?"}>).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
47
    }
48
}
49