GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 0cd9cc...8aad8f )
by Jasper
02:27
created

EquatableCollectionContains   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A matches() 0 8 3
A failureDescription() 0 8 2
1
<?php
2
3
/**
4
 * @license https://github.com/f500/equatable/blob/master/LICENSE MIT
5
 */
6
7
namespace F500\Equatable\PHPUnit\Constraint;
8
9
use F500\Equatable\EquatableMap;
10
use F500\Equatable\EquatableVector;
11
12
/**
13
 * @copyright Copyright (c) 2015 Future500 B.V.
14
 * @author    Jasper N. Brouwer <[email protected]>
15
 */
16
final class EquatableCollectionContains extends \PHPUnit_Framework_Constraint_TraversableContains
17
{
18
    /**
19
     * @inheritdoc
20
     */
21 15
    protected function matches($other)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
22
    {
23 15
        if ($other instanceof EquatableMap || $other instanceof EquatableVector) {
24 12
            return $other->contains($this->value);
25
        }
26
27 3
        return parent::matches($other);
28
    }
29
30
    /**
31
     * @inheritdoc
32
     */
33 3
    protected function failureDescription($other)
34
    {
35 3
        return sprintf(
36 3
            '%s %s',
37 3
            $other instanceof EquatableMap ? 'an equatable map' : 'an equatable vector',
38 3
            $this->toString()
39 3
        );
40
    }
41
}
42