Completed
Push — master ( 26c37b...25c8ee )
by DAOUDI
02:29
created

RequestMethodMapping   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A isValidMethod() 0 3 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: douadis
5
 * Date: 13/03/2018
6
 * Time: 10:37
7
 */
8
namespace SfForward\Util;
9
10
class RequestMethodMapping
11
{
12
    const REQUEST_METHOD_GET    = 'get';
13
    const REQUEST_METHOD_POST   = 'post';
14
15
    const REQUEST_QUERY_GET     = 'query';
16
    const REQUEST_QUERY_POST    = 'request';
17
18
    static public $methodsMapping = [
19
        self::REQUEST_METHOD_GET    => self::REQUEST_QUERY_GET,
20
        self::REQUEST_METHOD_POST   => self::REQUEST_QUERY_POST,
21
    ];
22
23
    /**
24
     * @param string $method
25
     *
26
     * @return bool
27
     */
28
    public static function isValidMethod($method)
29
    {
30
        return isset(self::$methodsMapping[$method]);
31
    }
32
}