Completed
Push — master ( 9c084b...cb34a7 )
by Konstantin
07:47 queued 05:41
created

ProphecyComparator   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 4
c 2
b 0
f 1
lcom 0
cbo 1
dl 0
loc 12
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A accepts() 0 4 3
A assertEquals() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Prophecy.
5
 * (c) Konstantin Kudryashov <[email protected]>
6
 *     Marcello Duarte <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Prophecy\Comparator;
13
14
use Prophecy\Prophecy\ProphecyInterface;
15
use SebastianBergmann\Comparator\ObjectComparator;
16
17
class ProphecyComparator extends ObjectComparator
18
{
19
    public function accepts($expected, $actual)
20
    {
21
        return is_object($expected) && is_object($actual) && $actual instanceof ProphecyInterface;
22
    }
23
24
    public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = array())
25
    {
26
        parent::assertEquals($expected, $actual->reveal(), $delta, $canonicalize, $ignoreCase, $processed);
27
    }
28
}
29