Completed
Push — master ( 74ffa0...ed410a )
by Mariano
10:21
created

ServerError   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 0 Features 3
Metric Value
c 4
b 0
f 3
dl 0
loc 13
wmc 3
lcom 0
cbo 2
ccs 8
cts 8
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 10 3
1
<?php
2
namespace Mcustiel\PowerRoute\Actions;
3
4
use Mcustiel\PowerRoute\Common\TransactionData;
5
6
class ServerError implements ActionInterface
7
{
8 4
    public function execute(TransactionData $transactionData, $argument = null)
9
    {
10 4
        $argument = (integer) $argument;
11 4
        if ($argument < 500 || $argument >= 600) {
12 3
            $argument = 500;
13 3
        }
14 4
        return $transactionData->setResponse(
15 4
            $transactionData->getResponse()->withStatus($argument)
16 4
        );
17
    }
18
}
19