Completed
Push — development ( 762b81...ba51da )
by Torben
01:40
created

ArrayUtility   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A isJsonArray() 0 7 2
1
<?php
2
namespace DERHANSEN\SfEventMgt\Utility;
3
4
/*
5
 * This file is part of the TYPO3 CMS project.
6
 *
7
 * It is free software; you can redistribute it and/or modify it under
8
 * the terms of the GNU General Public License, either version 2
9
 * of the License, or any later version.
10
 *
11
 * For the full copyright and license information, please read the
12
 * LICENSE.txt file that was distributed with this source code.
13
 *
14
 * The TYPO3 project - inspiring people to share!
15
 */
16
17
/**
18
 * ArrayUtility
19
 */
20
class ArrayUtility
21
{
22
    /**
23
     * Check if String is JSON Array
24
     *
25
     * @param string $string
26
     * @return bool
27
     */
28
    public static function isJsonArray($string)
29
    {
30
        if (!is_string($string)) {
31
            return false;
32
        }
33
        return is_array(json_decode($string, true));
34
    }
35
}
36