public function matches(array $jsonType)
    {
        if (array_key_exists(0, $this->jsonArray) && is_array($this->jsonArray[0])) {
            // a list of items
            $msg = '';
            foreach ($this->jsonArray as $array) {
                $res = $this->typeComparison($array, $jsonType);
                if ($res !== true) {
                    $msg .= "\n" . $res;
                }
            }
            if ($msg) {
                return $msg;
            }
            return true;
        }
        return $this->typeComparison($this->jsonArray, $jsonType);
    }
public function matches(array $jsonType)
    {
        if (array_key_exists(0, $this->jsonArray) && is_array($this->jsonArray[0])) {
            // a list of items
            $msg = '';
            foreach ($this->jsonArray as $array) {
                $res = $this->typeComparison($array, $jsonType);
                if ($res !== true) {
                    $msg .= "\n" . $res;
                }
            }
            if ($msg) {
                return $msg;
            }
            return true;
        }
        return $this->typeComparison($this->jsonArray, $jsonType);
    }
public function matches ( array $ jsonType ) { if ( array_key_exists ( 0 , $ this -> jsonArray ) && is_array ( $ this -> jsonArray [ 0 ] ) ) { // a list of items $ msg = '' ; foreach ( $ this -> jsonArray as $ array ) { $ res = $ this -> typeComparison ( $ array , $ jsonType ) ; if ( $ res !== true ) { $ msg .= "\n" . $ res ; } } if ( $ msg ) { return $ msg ; } return true ; } return $ this -> typeComparison ( $ this -> jsonArray , $ jsonType ) ; }
Checks data against passed JsonType.
If matching fails function returns a string with a message describing failure.
On success returns `true`.

@param array $jsonType
@return bool|string
Checks data against passed JsonType . If matching fails function returns a string with a message describing failure . On success returns true .