MiddlewareResult::continue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace ByJG\RestServer\Middleware;
4
5
class MiddlewareResult
6
{
7
    const STOP_PROCESSING_OTHERS = 'STOP_PROCESSING_OTHERS';
8
    const CONTINUE = 'CONTINUE';
9
    const STOP_PROCESSING = 'STOP_PROCESSING';
10
11
    protected $status = null;
12
13 12
    protected function __construct($status)
14
    {
15 12
        $this->status = $status;
16
    }
17
18 2
    public static function stopProcessingOthers()
19
    {
20 2
        return new MiddlewareResult(MiddlewareResult::STOP_PROCESSING_OTHERS);
21
    }
22
23
    public static function stopProcessing()
24
    {
25
        return new MiddlewareResult(MiddlewareResult::STOP_PROCESSING);
26
    }
27
28 12
    public static function continue()
29
    {
30 12
        return new MiddlewareResult(MiddlewareResult::CONTINUE);
31
    }
32
33 10
    public function getStatus()
34
    {
35 10
        return $this->status;
36
    }
37
38
    public function getOutputProcessorClass()
39
    {
40
        return $this->outputProcessorClass;
0 ignored issues
show
Bug Best Practice introduced by
The property outputProcessorClass does not exist on ByJG\RestServer\Middleware\MiddlewareResult. Did you maybe forget to declare it?
Loading history...
41
    }
42
}