@@ -12,10 +12,10 @@ |
||
| 12 | 12 | { |
| 13 | 13 | public static function create() |
| 14 | 14 | { |
| 15 | - $get = Get::create(); |
|
| 16 | - $file = File::create(); |
|
| 17 | - $server = Server::create(); |
|
| 18 | - $content = (new Content($server))->getBody(); |
|
| 15 | + $get = Get::create(); |
|
| 16 | + $file = File::create(); |
|
| 17 | + $server = Server::create(); |
|
| 18 | + $content = (new Content($server))->getBody(); |
|
| 19 | 19 | return self::createRequest($get, $content, $server, $file); |
| 20 | 20 | } |
| 21 | 21 | |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | ) |
| 23 | 23 | { |
| 24 | 24 | $this->get = $get; |
| 25 | - $this->server = $server; |
|
| 25 | + $this->server = $server; |
|
| 26 | 26 | $this->body = $body; |
| 27 | 27 | $this->file = $file; |
| 28 | 28 | } |
@@ -35,12 +35,12 @@ |
||
| 35 | 35 | public function bodyObject() |
| 36 | 36 | { |
| 37 | 37 | if (is_array($this->body)) { |
| 38 | - return ArrayUtil::converToObject($this->body); |
|
| 39 | - } |
|
| 38 | + return ArrayUtil::converToObject($this->body); |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | 41 | if (is_object($this->body)) { |
| 42 | - return $this->body; |
|
| 43 | - } |
|
| 42 | + return $this->body; |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | 45 | throw new \Exception("It wasn't possible convert to object"); |
| 46 | 46 | } |
@@ -19,8 +19,8 @@ |
||
| 19 | 19 | protected function clearHeadersFromHeadersList($headers, $needle) |
| 20 | 20 | { |
| 21 | 21 | foreach ($headers as $header) { |
| 22 | - if(stripos($header,$needle) !== false) { |
|
| 23 | - $headerParts = explode(':',$header); |
|
| 22 | + if (stripos($header, $needle) !== false) { |
|
| 23 | + $headerParts = explode(':', $header); |
|
| 24 | 24 | return trim($headerParts[1]); |
| 25 | 25 | } |
| 26 | 26 | } |
@@ -71,9 +71,9 @@ |
||
| 71 | 71 | |
| 72 | 72 | public function getContent() |
| 73 | 73 | { |
| 74 | - if (!empty($_POST)) { |
|
| 75 | - return $_POST; |
|
| 76 | - } |
|
| 74 | + if (!empty($_POST)) { |
|
| 75 | + return $_POST; |
|
| 76 | + } |
|
| 77 | 77 | |
| 78 | 78 | return file_get_contents("php://input"); |
| 79 | 79 | } |
@@ -6,8 +6,8 @@ |
||
| 6 | 6 | |
| 7 | 7 | class TextPlainFactory implements Factory |
| 8 | 8 | { |
| 9 | - public static function create() |
|
| 10 | - { |
|
| 11 | - return new TextPlain(); |
|
| 12 | - } |
|
| 9 | + public static function create() |
|
| 10 | + { |
|
| 11 | + return new TextPlain(); |
|
| 12 | + } |
|
| 13 | 13 | } |
| 14 | 14 | \ No newline at end of file |
@@ -7,8 +7,8 @@ |
||
| 7 | 7 | class PostFactory implements Factory |
| 8 | 8 | { |
| 9 | 9 | |
| 10 | - public static function create() |
|
| 11 | - { |
|
| 12 | - return new Post($_POST); |
|
| 13 | - } |
|
| 10 | + public static function create() |
|
| 11 | + { |
|
| 12 | + return new Post($_POST); |
|
| 13 | + } |
|
| 14 | 14 | } |
| 15 | 15 | \ No newline at end of file |
@@ -6,8 +6,8 @@ |
||
| 6 | 6 | |
| 7 | 7 | class FormUrlEncodedFactory implements Factory |
| 8 | 8 | { |
| 9 | - public static function create() |
|
| 10 | - { |
|
| 11 | - return new FormUrlEncoded(); |
|
| 12 | - } |
|
| 9 | + public static function create() |
|
| 10 | + { |
|
| 11 | + return new FormUrlEncoded(); |
|
| 12 | + } |
|
| 13 | 13 | } |
| 14 | 14 | \ No newline at end of file |
@@ -6,8 +6,8 @@ |
||
| 6 | 6 | |
| 7 | 7 | class FormDataFactory implements Factory |
| 8 | 8 | { |
| 9 | - public static function create() |
|
| 10 | - { |
|
| 11 | - return new FormData(); |
|
| 12 | - } |
|
| 9 | + public static function create() |
|
| 10 | + { |
|
| 11 | + return new FormData(); |
|
| 12 | + } |
|
| 13 | 13 | } |
| 14 | 14 | \ No newline at end of file |
@@ -6,8 +6,8 @@ |
||
| 6 | 6 | |
| 7 | 7 | class JsonFactory implements Factory |
| 8 | 8 | { |
| 9 | - public static function create() |
|
| 10 | - { |
|
| 11 | - return new Json(); |
|
| 12 | - } |
|
| 9 | + public static function create() |
|
| 10 | + { |
|
| 11 | + return new Json(); |
|
| 12 | + } |
|
| 13 | 13 | } |
| 14 | 14 | \ No newline at end of file |
@@ -6,8 +6,8 @@ |
||
| 6 | 6 | |
| 7 | 7 | class XmlFactory implements Factory |
| 8 | 8 | { |
| 9 | - public static function create() |
|
| 10 | - { |
|
| 11 | - return new XML(); |
|
| 12 | - } |
|
| 9 | + public static function create() |
|
| 10 | + { |
|
| 11 | + return new XML(); |
|
| 12 | + } |
|
| 13 | 13 | } |
| 14 | 14 | \ No newline at end of file |