Issues (653)

src/ga4/Service.php (22 issues)

1
<?php
2
/**
3
 * Instant Analytics plugin for Craft CMS
4
 *
5
 * @author    nystudio107
0 ignored issues
show
The tag in position 1 should be the @package tag
Loading history...
Content of the @author tag must be in the form "Display Name <[email protected]>"
Loading history...
6
 * @copyright Copyright (c) 2017 nystudio107
0 ignored issues
show
The tag in position 2 should be the @author tag
Loading history...
@copyright tag must contain a year and the name of the copyright holder
Loading history...
7
 * @link      http://nystudio107.com
0 ignored issues
show
The tag in position 3 should be the @copyright tag
Loading history...
8
 * @package   InstantAnalytics
0 ignored issues
show
The tag in position 4 should be the @link tag
Loading history...
9
 * @since     1.0.0
10
 */
0 ignored issues
show
PHP version not specified
Loading history...
Missing @category tag in file comment
Loading history...
Missing @license tag in file comment
Loading history...
11
12
namespace nystudio107\instantanalyticsGa4\ga4;
13
14
use Br33f\Ga4\MeasurementProtocol\Service as BaseService;
15
16
/**
0 ignored issues
show
Missing short description in doc comment
Loading history...
17
 * @author    nystudio107
0 ignored issues
show
The tag in position 1 should be the @package tag
Loading history...
Content of the @author tag must be in the form "Display Name <[email protected]>"
Loading history...
Tag value for @author tag indented incorrectly; expected 2 spaces but found 4
Loading history...
18
 * @package   InstantAnalytics
0 ignored issues
show
Tag value for @package tag indented incorrectly; expected 1 spaces but found 3
Loading history...
19
 * @since     1.2.0
0 ignored issues
show
The tag in position 3 should be the @author tag
Loading history...
Tag value for @since tag indented incorrectly; expected 3 spaces but found 5
Loading history...
20
 */
0 ignored issues
show
Missing @category tag in class comment
Loading history...
Missing @license tag in class comment
Loading history...
Missing @link tag in class comment
Loading history...
21
class Service extends BaseService
22
{
23
    protected array $additionalParams = [];
24
25
    public function setAdditionalQueryParam(string $name, ?string $value): void
0 ignored issues
show
Missing doc comment for function setAdditionalQueryParam()
Loading history...
26
    {
27
        if ($value === null) {
28
            unset($this->additionalParams[$name]);
29
        } else {
30
            $this->additionalParams[$name] = $value;
31
        }
32
    }
33
34
    public function deleteAdditionalQueryParam(string $name): void
0 ignored issues
show
Missing doc comment for function deleteAdditionalQueryParam()
Loading history...
35
    {
36
        unset($this->additionalParams[$name]);
37
    }
38
39
    public function getQueryParameters(): array
0 ignored issues
show
Missing doc comment for function getQueryParameters()
Loading history...
40
    {
41
        $parameters = parent::getQueryParameters();
42
43
        // Return without overwriting existing
44
        return $parameters + $this->additionalParams;
45
    }
46
}
47