@@ -10,33 +10,33 @@ |
||
10 | 10 | |
11 | 11 | |
12 | 12 | class Option { |
13 | - const __default = null; |
|
14 | - |
|
15 | - const OPTION_SHALLOW = 'shallow'; |
|
16 | - const SHALLOW_TRUE = 'true'; |
|
17 | - const SHALLOW_FALSE = 'false'; |
|
18 | - |
|
19 | - const OPTION_PRINT = 'print'; |
|
20 | - const PRINT_PRETTY = 'pretty'; |
|
21 | - const PRINT_SILENT = 'silent'; |
|
22 | - |
|
23 | - const REQ_TYPE_GET = 0; |
|
24 | - const REQ_TYPE_PUT = 1; |
|
25 | - const REQ_TYPE_POST = 2; |
|
26 | - const REQ_TYPE_PATCH = 3; |
|
27 | - const REQ_TYPE_DELETE = 4; |
|
28 | - |
|
29 | - public static function isAllowPrint( $reqType = self::REQ_TYPE_GET, $pType = self::PRINT_PRETTY ) { |
|
30 | - if ( $pType == self::PRINT_PRETTY ) { |
|
31 | - return true; |
|
32 | - } |
|
33 | - |
|
34 | - if ( $pType == self::PRINT_SILENT ) { |
|
35 | - if ( $reqType == self::REQ_TYPE_DELETE ) { |
|
36 | - return false; |
|
37 | - } |
|
38 | - } |
|
39 | - |
|
40 | - return true; |
|
41 | - } |
|
13 | + const __default = null; |
|
14 | + |
|
15 | + const OPTION_SHALLOW = 'shallow'; |
|
16 | + const SHALLOW_TRUE = 'true'; |
|
17 | + const SHALLOW_FALSE = 'false'; |
|
18 | + |
|
19 | + const OPTION_PRINT = 'print'; |
|
20 | + const PRINT_PRETTY = 'pretty'; |
|
21 | + const PRINT_SILENT = 'silent'; |
|
22 | + |
|
23 | + const REQ_TYPE_GET = 0; |
|
24 | + const REQ_TYPE_PUT = 1; |
|
25 | + const REQ_TYPE_POST = 2; |
|
26 | + const REQ_TYPE_PATCH = 3; |
|
27 | + const REQ_TYPE_DELETE = 4; |
|
28 | + |
|
29 | + public static function isAllowPrint( $reqType = self::REQ_TYPE_GET, $pType = self::PRINT_PRETTY ) { |
|
30 | + if ( $pType == self::PRINT_PRETTY ) { |
|
31 | + return true; |
|
32 | + } |
|
33 | + |
|
34 | + if ( $pType == self::PRINT_SILENT ) { |
|
35 | + if ( $reqType == self::REQ_TYPE_DELETE ) { |
|
36 | + return false; |
|
37 | + } |
|
38 | + } |
|
39 | + |
|
40 | + return true; |
|
41 | + } |
|
42 | 42 | } |
43 | 43 | \ No newline at end of file |