Str   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 16
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A isJson() 0 6 1
1
<?php
2
3
namespace sixlive\Laravel\JsonSchemaAssertions\Support;
4
5
class Str
6
{
7
    /**
8
     * Test to see if a string is json.
9
     *
10
     * @param  string  $string
11
     *
12
     * @return bool
13
     */
14
    public static function isJson($string)
15
    {
16
        json_decode($string);
17
18
        return json_last_error() === JSON_ERROR_NONE;
19
    }
20
}
21