AbstractResponse   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1
Metric Value
dl 0
loc 16
wmc 1
lcom 0
cbo 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
getValue() 0 1 ?
A process() 0 6 1
1
<?php
2
3
namespace ChainableTest\Fixtures;
4
5
use Chainable\ChainableInterface;
6
use Chainable\Result\ChainResult;
7
use Chainable\Result\ChainResultInterface;
8
9
abstract class AbstractResponse implements ChainableInterface
10
{
11
    abstract public function getValue();
12
13
    /**
14
     * @param mixed $data
15
     *
16
     * @return ChainResultInterface
17
     */
18
    public function process(... $data)
19
    {
20
        $value = reset($data);
21
22
        return new ChainResult($this->getValue(), reset($value) === $this->getValue());
23
    }
24
}
25