Issues (1)

src/Laravel/BrowserLocaleServiceProvider.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace CodeZero\BrowserLocale\Laravel;
4
5
use CodeZero\BrowserLocale\BrowserLocale;
6
use Illuminate\Support\ServiceProvider;
7
use Request;
8
9
class BrowserLocaleServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Register any application services.
13
     *
14
     * @return void
15
     */
16
    public function register()
17
    {
18
        $this->registerBrowserLocale();
19
    }
20
21
    /**
22
     * Register BrowserLocale.
23
     *
24
     * @return void
25
     */
26
    protected function registerBrowserLocale()
27
    {
28
        $this->app->bind(BrowserLocale::class, function () {
29
            return new BrowserLocale(
30
                Request::server('HTTP_ACCEPT_LANGUAGE')
0 ignored issues
show
It seems like Request::server('HTTP_ACCEPT_LANGUAGE') can also be of type array; however, parameter $httpAcceptLanguages of CodeZero\BrowserLocale\B...erLocale::__construct() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

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

30
                /** @scrutinizer ignore-type */ Request::server('HTTP_ACCEPT_LANGUAGE')
Loading history...
31
            );
32
        });
33
    }
34
}
35