GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#21)
by Stefan
01:48
created

GoogleTagManager::getData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/*
3
 * This file is part of the GoogleTagManagerBundle project
4
 *
5
 * (c) Philipp Braeutigam <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Xynnn\GoogleTagManagerBundle\Service;
12
13
/**
14
 * Class GoogleTagManager
15
 *
16
 * @package Xynnn\GoogleTagManagerBundle\Service
17
 */
18
class GoogleTagManager implements GoogleTagManagerInterface
19
{
20
    /**
21
     * @var bool
22
     */
23
    private $enabled;
24
25
    /**
26
     * @var string
27
     */
28
    private $id;
29
30
    /**
31
     * @var array
32
     */
33
    private $data = array();
34
35
    /**
36
     * @param $enabled
37
     * @param $id
38
     */
39
    public function __construct($enabled, $id)
40
    {
41
        $this->enabled = (bool)$enabled;
42
        $this->id = $id;
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    public function addData($key, $value)
49
    {
50
        $this->setData($key, $value);
51
    }
52
53
    /**
54
     * {@inheritdoc}
55
     */
56
    public function setData($key, $value)
57
    {
58
        $this->data[$key] = $value;
59
    }
60
61
    /**
62
     * {@inheritdoc}
63
     */
64
    public function mergeData($key, $value)
65
    {
66
        $merge = array();
67
        if (array_key_exists($key, $this->data)) {
68
            $merge = $this->data[$key];
69
        }
70
71
        $this->setData($key, array_merge_recursive($merge, $value));
72
    }
73
74
    /**
75
     * {@inheritdoc}
76
     */
77
    public function isEnabled()
78
    {
79
        return $this->enabled;
80
    }
81
82
    /**
83
     * {@inheritdoc}
84
     */
85
    public function getId()
86
    {
87
        return $this->id;
88
    }
89
90
    /**
91
     * {@inheritdoc}
92
     */
93
    public function getData()
94
    {
95
        return $this->data;
96
    }
97
98
    /**
99
     * {@inheritdoc}
100
     */
101
    public function hasData()
102
    {
103
        return is_array($this->getData())
104
        && count($this->getData()) > 0;
105
    }
106
}
107