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::mergeRecursive()   B
last analyzed

Complexity

Conditions 6
Paths 2

Size

Total Lines 20
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 8.8571
c 0
b 0
f 0
cc 6
eloc 12
nc 2
nop 2
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