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

ArrayUtility::isJsonArray()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
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