@@ -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 |
@@ -6,5 +6,5 @@ |
||
| 6 | 6 | |
| 7 | 7 | interface Factory |
| 8 | 8 | { |
| 9 | - public static function create(); |
|
| 9 | + public static function create(); |
|
| 10 | 10 | } |
| 11 | 11 | \ No newline at end of file |
@@ -27,14 +27,14 @@ |
||
| 27 | 27 | return $array; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - public static function converToObject(array $data) |
|
| 31 | - { |
|
| 32 | - $object = new \stdClass(); |
|
| 30 | + public static function converToObject(array $data) |
|
| 31 | + { |
|
| 32 | + $object = new \stdClass(); |
|
| 33 | 33 | |
| 34 | - foreach ($data as $key => $value) { |
|
| 35 | - $object->$key = $value; |
|
| 36 | - } |
|
| 34 | + foreach ($data as $key => $value) { |
|
| 35 | + $object->$key = $value; |
|
| 36 | + } |
|
| 37 | 37 | |
| 38 | - return $object; |
|
| 38 | + return $object; |
|
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | \ No newline at end of file |
@@ -6,24 +6,24 @@ |
||
| 6 | 6 | |
| 7 | 7 | class TextPlain implements Handler, Advancer |
| 8 | 8 | { |
| 9 | - private $handler; |
|
| 9 | + private $handler; |
|
| 10 | 10 | |
| 11 | - public function getBody($content) |
|
| 12 | - { |
|
| 13 | - return $content; |
|
| 14 | - } |
|
| 11 | + public function getBody($content) |
|
| 12 | + { |
|
| 13 | + return $content; |
|
| 14 | + } |
|
| 15 | 15 | |
| 16 | - public function next(Handler $handler) |
|
| 17 | - { |
|
| 18 | - $this->handler = $handler; |
|
| 19 | - } |
|
| 16 | + public function next(Handler $handler) |
|
| 17 | + { |
|
| 18 | + $this->handler = $handler; |
|
| 19 | + } |
|
| 20 | 20 | |
| 21 | - public function handle($server) |
|
| 22 | - { |
|
| 23 | - if (ContentHelper::contentIs($server, 'text/plain')) { |
|
| 24 | - return $this->getBody($server->getContent()); |
|
| 25 | - } |
|
| 21 | + public function handle($server) |
|
| 22 | + { |
|
| 23 | + if (ContentHelper::contentIs($server, 'text/plain')) { |
|
| 24 | + return $this->getBody($server->getContent()); |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - return $this->handler->handle($server); |
|
| 28 | - } |
|
| 27 | + return $this->handler->handle($server); |
|
| 28 | + } |
|
| 29 | 29 | } |
| 30 | 30 | \ No newline at end of file |