Completed
Pull Request — master (#30)
by
unknown
08:18
created

SameMatcher::differ()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace Peridot\Leo\Matcher;
4
5
use Peridot\Leo\Matcher\Template\ArrayTemplate;
6
use Peridot\Leo\Matcher\Template\TemplateInterface;
7
8
/**
9
 * SameMatcher determines if an actual value is identical to the expected value.
10
 * @package Peridot\Leo\Matcher
11
 */
12
class SameMatcher extends AbstractMatcher
13
{
14
    public function differ($actual, $expected) {
0 ignored issues
show
Unused Code introduced by
The parameter $actual is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $expected is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
15
        return "THE CALCULATED DIFF";
16
    }
17
18
    /**
19
     * Match if the actual value is identical to the expected value using an ===
20
     * comparison.
21
     *
22
     * @param  mixed $actual
23
     * @return bool
24
     */
25
    public function doMatch($actual)
26
    {
27
        return $this->expected === $actual;
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     *
33
     * @return TemplateInterface
34
     */
35
    public function getDefaultTemplate()
36
    {
37
        return new ArrayTemplate([
38
            'default' => 'Expected {{actual}} to be identical to {{expected}}. Difference: {{diff}}',
39
            'negated' => 'Expected {{actual}} not to be identical to {{expected}}',
40
        ]);
41
    }
42
}
43