File tree Expand file tree Collapse file tree 2 files changed +27
-6
lines changed Expand file tree Collapse file tree 2 files changed +27
-6
lines changed Original file line number Diff line number Diff line change 25
25
use MultiTheftAuto \Sdk \Model \Resources ;
26
26
use MultiTheftAuto \Sdk \Model \Server ;
27
27
use MultiTheftAuto \Sdk \Response \HttpStatusVerification ;
28
+ use MultiTheftAuto \Sdk \Utils \Input ;
28
29
use MultiTheftAuto \Sdk \Utils \Translator ;
29
30
30
31
class Mta
@@ -81,12 +82,7 @@ public function getResource(string $resourceName): Resource
81
82
82
83
public static function getInput (): ?array
83
84
{
84
- $ input = file_get_contents ('php://input ' );
85
- if (!$ input ) {
86
- return null ;
87
- }
88
-
89
- return Translator::fromServer ($ input )?? null ;
85
+ return Translator::fromServer (Input::get ())?? null ;
90
86
}
91
87
92
88
public static function doReturn (...$ arguments ): void
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*****************************************************************************
4
+ *
5
+ * PROJECT: MTA PHP SDK
6
+ * LICENSE: See LICENSE in the top level directory
7
+ * FILE: Input.php
8
+ * VERSION: 1.0.0
9
+ *
10
+ * Multi Theft Auto is available from http://www.multitheftauto.com/
11
+ *
12
+ *****************************************************************************/
13
+
14
+ declare (strict_types=1 );
15
+
16
+ namespace MultiTheftAuto \Sdk \Utils ;
17
+
18
+ class Input
19
+ {
20
+ public static function get (): ?string
21
+ {
22
+ $ input = file_get_contents ('php://input ' );
23
+ return $ input ?? null ;
24
+ }
25
+ }
You can’t perform that action at this time.
0 commit comments