ValidatorPasses::failureDescription()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 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