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.

Options   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 8
lcom 0
cbo 1
dl 0
loc 53
rs 10
c 1
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getIncludeAssets() 0 4 1
A setIncludeAssets() 0 4 1
B mergeRecursive() 0 20 6
1
<?php
2
/**
3
 * Options for renderers
4
 *
5
 * @category   StrokerForm
6
 * @package    StrokerForm\Renderer
7
 * @subpackage JqueryValidate
8
 * @copyright  2012 Bram Gerritsen
9
 * @version    SVN: $Id$
10
 */
11
12
namespace StrokerForm\Renderer;
13
14
use Zend\Stdlib\AbstractOptions;
15
16
class Options extends AbstractOptions
17
{
18
    /**
19
     * @var bool
20
     */
21
    private $includeAssets = true;
22
23
    /**
24
     * @return bool
25
     */
26
    public function getIncludeAssets()
27
    {
28
        return $this->includeAssets;
29
    }
30
31
    /**
32
     * @param bool $includeAssets
33
     */
34
    public function setIncludeAssets($includeAssets)
35
    {
36
        $this->includeAssets = $includeAssets;
37
    }
38
39
    /**
40
     * True merging of two arrays, as opposed to PHPs default array_merge_recursive,
41
     * which doesn't do true merging of array keys
42
     *
43
     * @param array $a The original array
44
     * @param array $b The array to merge
45
     *
46
     * @return array
47
     */
48
    public function mergeRecursive(array $a, array $b)
49
    {
50
        $merged = $a;
51
52
        if (is_array($b)) {
53
            foreach ($b as $key => $val) {
54
                if (is_array($b[$key])) {
55
                    if (isset($merged[$key])) {
56
                        $merged[$key] = is_array($merged[$key]) ? $this->mergeRecursive($merged[$key], $b[$key]) : $b[$key];
57
                    } else {
58
                        $merged[$key] = $b[$key];
59
                    }
60
                } else {
61
                    $merged[$key] = $val;
62
                }
63
            }
64
        }
65
66
        return $merged;
67
    }
68
}
69