Passed
Push — master ( 0ce2a0...71b25b )
by Thomas
02:06 queued 16s
created

ShopwareEnvironmentVariables::onPage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 14
nc 1
nop 1
dl 0
loc 18
rs 9.4285
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace ShopwareEnvironmentVariables;
4
5
use Shopware\Components\Plugin;
0 ignored issues
show
Bug introduced by
The type Shopware\Components\Plugin was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Shopware\Components\Plugin\Context\InstallContext;
0 ignored issues
show
Bug introduced by
The type Shopware\Components\Plugin\Context\InstallContext was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
8
class ShopwareEnvironmentVariables extends Plugin
9
{
10
    public static function getSubscribedEvents()
11
    {
12
        return ['Enlight_Controller_Action_PostDispatchSecure_Frontend' => 'onPage'];
13
    }
14
15
    public function onPage(\Enlight_Event_EventArgs $args)
0 ignored issues
show
Bug introduced by
The type Enlight_Event_EventArgs was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
16
    {
17
        /** @var \Shopware_Controllers_Frontend_Detail $subject */
18
        $subject = $args->getSubject();
0 ignored issues
show
Unused Code introduced by
The assignment to $subject is dead and can be removed.
Loading history...
19
        ini_set('xdebug.var_display_max_depth', '5');
20
        ini_set('xdebug.var_display_max_children', '256');
21
        ini_set('xdebug.var_display_max_data', '1024');
22
        echo '<pre>';
23
        var_dump(Shopware()->Config()->get('mailer_mailer'));
0 ignored issues
show
Bug introduced by
The function Shopware 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
        var_dump(/** @scrutinizer ignore-call */ Shopware()->Config()->get('mailer_mailer'));
Loading history...
Security Debugging Code introduced by
var_dump(Shopware()->Con...->get('mailer_mailer')) looks like debug code. Are you sure you do not want to remove it?
Loading history...
24
        echo '</pre>';
25
        echo '<pre>';
26
        var_dump(
27
            Shopware()->Container()
28
                ->get('shopware.plugin.config_reader')->getByPluginName(
29
                    'SwagPaymentPaypal', Shopware()->Shop()
30
                )['paypalUsername']
31
        );
32
        echo '</pre>';
33
    }
34
35
    public function install(InstallContext $context)
36
    {
37
        $context->scheduleClearCache(InstallContext::CACHE_LIST_FRONTEND);
38
    }
39
}
40