Completed
Push — master ( 1d628c...646e70 )
by TJ
10:26
created

Str   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 14
ccs 3
cts 3
cp 1
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
     * Test to see if a string is json
8
     * 
9
     * @param  mixed  $schema
0 ignored issues
show
Bug introduced by
There is no parameter named $schema. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
10
     * @return void
11
     */
12 4
    public static function isJson($string)
13
    {
14 4
        json_decode($string);
15
16 4
        return json_last_error() === JSON_ERROR_NONE;
17
    }
18
}
19