RequireCommand::generate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13

Duplication

Lines 13
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 13
loc 13
ccs 0
cts 4
cp 0
rs 9.8333
c 0
b 0
f 0
cc 1
nc 1
nop 4
crap 2
1
<?php
2
3
namespace ByTIC\GoogleAnalytics\Tracking\Renderer\Script\AnalyticsJs;
4
5
use ByTIC\GoogleAnalytics\Tracking\Data\Tracker;
6
use ByTIC\GoogleAnalytics\Tracking\Renderer\Script\AnalyticsJs;
7
8
/**
9
 * Class RequireCommand
10
 * @package ByTIC\GoogleAnalytics\Tracking\Renderer\Script\AnalyticsJs
11
 */
12 View Code Duplication
class RequireCommand
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
13
{
14
    /**
15
     * @param Tracker $tracker
16
     * @param string $functionName
17
     * @return string
18
     */
19
    public static function generate(
20
        $tracker,
21
        $pluginName,
22
        $pluginOptions = null,
0 ignored issues
show
Unused Code introduced by
The parameter $pluginOptions is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
23
        $functionName = AnalyticsJs::DEFAULT_FUNCTION_NAME
24
    ) {
25
        $params = [
26
            $tracker->getCommandAlias() . 'require',
27
            $pluginName,
28
        ];
29
30
        return MethodCall::generate($params, $functionName);
31
    }
32
}
33