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

MethodNotAllowed   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 20
ccs 6
cts 6
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getResponseCode() 0 4 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