ArrayUtility::isJsonArray()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Extension "sf_event_mgt" for TYPO3 CMS.
7
 *
8
 * For the full copyright and license information, please read the
9
 * LICENSE.txt file that was distributed with this source code.
10
 */
11
12
namespace DERHANSEN\SfEventMgt\Utility;
13
14
class ArrayUtility
15
{
16
    /**
17
     * Check if the given value is JSON Array
18
     */
19
    public static function isJsonArray(mixed $value): bool
20
    {
21
        if (!is_string($value)) {
22
            return false;
23
        }
24
25
        return is_array(json_decode($value, true));
26
    }
27
}
28