Issues (64)

app/Http/ViewComposers/SettingsComposer.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace App\Http\ViewComposers;
4
5
use App\Services\ThemeServices;
6
use Illuminate\View\View;
7
8
class SettingsComposer
9
{
10
    protected $theme;
11
12
    /**
13
     * Create a new instance.
14
     *
15
     * @return void
16
     */
17
    public function __construct()
18
    {
19
        $this->theme = ThemeServices::getTheTheme();
20
    }
21
22
    /**
23
     * Bind data to the view.
24
     *
25
     * @param View $view
26
     *
27
     * @return void
28
     */
29
    public function compose(View $view)
30
    {
31
        $theme = ThemeServices::checkForRandomTheme($this->theme);
0 ignored issues
show
$this->theme of type string is incompatible with the type object expected by parameter $theme of App\Services\ThemeServices::checkForRandomTheme(). ( Ignorable by Annotation )

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

31
        $theme = ThemeServices::checkForRandomTheme(/** @scrutinizer ignore-type */ $this->theme);
Loading history...
32
33
        $data = [
34
            'theme' => $theme,
35
        ];
36
37
        $view->with($data);
38
    }
39
}
40