Status202   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
eloc 4
dl 0
loc 11
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A consolidate() 0 6 1
1
<?php namespace Comodojo\Dispatcher\Response\Preprocessor;
2
3
use \Comodojo\Dispatcher\Response\Model as Response;
4
5
/**
6
 * Status: Created
7
 *
8
 * @NOTE: according to HTTP/1.1, 202 header SHOULD HAVE status description
9
 *  in body... just in case
10
 *
11
 * @package     Comodojo Dispatcher
12
 * @author      Marco Giovinazzi <[email protected]>
13
 * @license     MIT
14
 *
15
 * LICENSE:
16
 *
17
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
 * THE SOFTWARE.
24
 */
25
26
class Status202 extends Status200 {
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function consolidate(Response $response) {
32
33
        $response->getHeaders()
34
            ->set('Status: 202 Accepted');
35
36
        parent::consolidate();
0 ignored issues
show
Bug introduced by
The call to Comodojo\Dispatcher\Resp...tatus200::consolidate() has too few arguments starting with response. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

36
        parent::/** @scrutinizer ignore-call */ 
37
                consolidate();

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
37
38
    }
39
40
}
41