ValidatorPasses   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 27
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A matches() 0 4 1
A toString() 0 4 1
A failureDescription() 0 4 1
1
<?php namespace HSkrasek\JsonSchema;
2
3
use League\JsonGuard\Validator;
4
use PHPUnit\Framework\Constraint\Constraint;
5
6
class ValidatorPasses extends Constraint
7
{
8
    /**
9
     * @param Validator $other
10
     *
11
     * @return bool
12
     */
13
    protected function matches($other)
14
    {
15
        return $other->passes();
16
    }
17
18
    /**
19
     * Returns a string representation of the object.
20
     *
21
     * @return string
22
     */
23
    public function toString()
24
    {
25
        return 'matches the provided schema';
26
    }
27
28
    protected function failureDescription($other)
29
    {
30
        return 'the provided JSON ' . $this->toString();
31
    }
32
}
33