MethodNotAllowedException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 4
1
<?php
2
/**
3
 * slince routing library
4
 * @author Tao <[email protected]>
5
 */
6
namespace Slince\Routing\Exception;
7
8
class MethodNotAllowedException extends \Exception
9
{
10
    /**
11
     * @var array
12
     */
13
    protected $_allowedMethods = array();
14
15
    public function __construct(array $allowedMethods, $message = null, $code = 0, $previous = null)
16
    {
17
        $this->_allowedMethods = array_map('strtoupper', $allowedMethods);
18
19
        parent::__construct($message, $code, $previous);
20
    }
21
22
    /**
23
     * Gets the allowed HTTP methods.
24
     * @return array
25
     */
26
    public function getAllowedMethods()
27
    {
28
        return $this->_allowedMethods;
29
    }
30
}
31