Completed
Push — master ( fba866...b10a48 )
by Ori
03:03
created

Utils::load_json_resource()   B

Complexity

Conditions 6
Paths 8

Size

Total Lines 23
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 8.5906
c 0
b 0
f 0
cc 6
eloc 17
nc 8
nop 1
1
<?php
2
namespace frictionlessdata\tableschema;
3
4
// TODO: refactor to an independenct package (used by both tableschema and datapackage)
5
class Utils
6
{
7
    public static function isJsonString($json)
8
    {
9
        return (
10
            is_string($json)
11
            && (strpos(ltrim($json), "{") === 0)
12
        );
13
    }
14
}
15