Completed
Branch develop (4c3d66)
by Mariano
11:18
created

ServerError::execute()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 8
ccs 6
cts 6
cp 1
rs 9.4285
cc 2
eloc 4
nc 1
nop 1
crap 2
1
<?php
2
namespace Mcustiel\PowerRoute\Actions;
3
4
use Mcustiel\PowerRoute\Common\TransactionData;
5
use Mcustiel\PowerRoute\Common\ArgumentAware;
6
7
class ServerError implements ActionInterface
8
{
9
    use ArgumentAware;
10
11 3
    public function execute(TransactionData $transactionData)
12
    {
13 3
        return $transactionData->setResponse(
14 3
            $transactionData->getResponse()->withStatus(
15 3
                $this->argument ? $this->argument : 500
16 3
            )
17 3
        );
18
    }
19
}
20