Passed
Push — master ( 01baf6...9ed857 )
by Vitor de
04:10
created

MethodNotAllowed::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
3
namespace GFG\Hek\Exceptions;
4
5
class MethodNotAllowed extends \InvalidArgumentException implements ResponseInterface
6
{
7
    /**
8
     * @param string    $methodName
9
     * @param Exception $previous
0 ignored issues
show
Bug introduced by
There is no parameter named $previous. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
10
     */
11 2
    public function __construct($methodName)
12
    {
13 2
        $message = sprintf('Method %s not allowed', $methodName);
14 2
        parent::__construct($message);
15 2
    }
16
17
    /**
18
     * {@inheritdoc}
19
     */
20 2
    public function getResponseCode()
21
    {
22 2
        return 405;
23
    }
24
}
25