InvalidMethodException::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 3
1
<?php
2
namespace AsimovExpress\AdobeConnect\Http;
3
4
class InvalidMethodException extends \Exception
5
{
6
    /**
7
     * The http method used in the request.
8
     *
9
     * @var string
10
     */
11
    protected $method;
12
13
    /**
14
     * Create a new InvalidMethodException instance.
15
     *
16
     * @param string $method The http method intended to use.
17
     * @param string $message Custom message to be shown.
18
     * @param int $code Exception code.
19
     */
20
    public function __construct($method, $message = '', $code = 0)
21
    {
22
        $this->method = $method;
23
        if (!$message) {
24
            $message = "The HTTP method {$this->method} is not allowed in this package, use POST instead.";
25
        }
26
        parent::__construct($message, $code);
27
    }
28
}
29