Issues (281)

Branch: master

src/Backend/Modules/Analytics/Actions/Settings.php (2 issues)

Labels
Severity
1
<?php
2
3
namespace Backend\Modules\Analytics\Actions;
4
5
use Backend\Core\Engine\Base\ActionIndex;
6
use Backend\Core\Engine\Model;
7
use Backend\Modules\Analytics\Form\SettingsType;
8
9
/**
10
 * This is the settings-action (default), it will be used to couple your analytics
11
 * account
12
 */
13
final class Settings extends ActionIndex
14
{
15 3
    public function execute(): void
16
    {
17 3
        parent::execute();
18
19 3
        $settingsForm = new SettingsType(
20 3
            'settings',
21 3
            $this->get('fork.settings'),
0 ignored issues
show
It seems like $this->get('fork.settings') can also be of type null; however, parameter $settings of Backend\Modules\Analytic...ingsType::__construct() does only seem to accept Common\ModulesSettings, 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

21
            /** @scrutinizer ignore-type */ $this->get('fork.settings'),
Loading history...
22 3
            $this->get('analytics.google_analytics_service')
0 ignored issues
show
It seems like $this->get('analytics.google_analytics_service') can also be of type null; however, parameter $googleServiceAnalytics of Backend\Modules\Analytic...ingsType::__construct() does only seem to accept Google_Service_Analytics, 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

22
            /** @scrutinizer ignore-type */ $this->get('analytics.google_analytics_service')
Loading history...
23
        );
24
25 3
        if ($settingsForm->handle()) {
26
            $this->redirect(Model::createUrlForAction('Settings'));
27
        }
28 3
        $settingsForm->parse($this->template);
29
30 3
        if ($this->get('fork.settings')->get($this->getModule(), 'web_property_id')) {
31
            $this->template->assign(
32
                'web_property_id',
33
                $this->get('fork.settings')->get($this->getModule(), 'web_property_id')
34
            );
35
        }
36 3
        if ($this->get('fork.settings')->get($this->getModule(), 'profile')) {
37
            $this->template->assign(
38
                'profile',
39
                $this->get('fork.settings')->get($this->getModule(), 'profile')
40
            );
41
        }
42
43 3
        $this->display();
44 3
    }
45
}
46