Issues (10)

src/ServiceProvider.php (3 issues)

Labels
Severity
1
<?php
2
3
namespace ElfSundae\BearyChat\Laravel;
4
5
use Illuminate\Support\ServiceProvider as LaravelServiceProvider;
6
7
class ServiceProvider extends LaravelServiceProvider
8
{
9
    /**
10
     * Register the service provider.
11
     *
12
     * @return void
13
     */
14
    public function register()
15
    {
16
        if (is_a($this->app, 'Laravel\Lumen\Application')) {
17
            $this->app->configure('bearychat');
0 ignored issues
show
The method configure() does not exist on Illuminate\Contracts\Foundation\Application. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

17
            $this->app->/** @scrutinizer ignore-call */ 
18
                        configure('bearychat');

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
18
        }
19
20
        $this->mergeConfigFrom($from = __DIR__.'/../config/bearychat.php', 'bearychat');
21
22
        if ($this->app->runningInConsole()) {
0 ignored issues
show
The method runningInConsole() does not exist on Illuminate\Contracts\Foundation\Application. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

22
        if ($this->app->/** @scrutinizer ignore-call */ runningInConsole()) {

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
23
            $this->publishes([$from => base_path('config/bearychat.php')], 'bearychat');
0 ignored issues
show
The function base_path was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

23
            $this->publishes([$from => /** @scrutinizer ignore-call */ base_path('config/bearychat.php')], 'bearychat');
Loading history...
24
        }
25
26
        $this->app->singleton('bearychat', function ($app) {
27
            return (new ClientManager)
28
                ->setDefaultName($app['config']->get('bearychat.default'))
29
                ->setClientsDefaults($app['config']->get('bearychat.clients_defaults'))
30
                ->setClientsConfig($app['config']->get('bearychat.clients'));
31
        });
32
33
        $this->app->alias('bearychat', ClientManager::class);
34
    }
35
}
36