diff options
Diffstat (limited to 'vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Text.php')
-rw-r--r-- | vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Text.php | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Text.php b/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Text.php index e2ce0ca..d6fa3cd 100644 --- a/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Text.php +++ b/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Text.php @@ -1,38 +1,38 @@ -<?php - -namespace PayPalHttp\Serializer; - -use PayPalHttp\HttpRequest; -use PayPalHttp\Serializer; - -/** - * Class Text - * @package PayPalHttp\Serializer - * - * Serializer for Text content types. - */ -class Text implements Serializer -{ - - public function contentType() - { - return "/^text\\/.*/"; - } - - public function encode(HttpRequest $request) - { - $body = $request->body; - if (is_string($body)) { - return $body; - } - if (is_array($body)) { - return json_encode($body); - } - return implode(" ", $body); - } - - public function decode($data) - { - return $data; - } -} +<?php
+
+namespace PayPalHttp\Serializer;
+
+use PayPalHttp\HttpRequest;
+use PayPalHttp\Serializer;
+
+/**
+ * Class Text
+ * @package PayPalHttp\Serializer
+ *
+ * Serializer for Text content types.
+ */
+class Text implements Serializer
+{
+
+ public function contentType()
+ {
+ return "/^text\\/.*/";
+ }
+
+ public function encode(HttpRequest $request)
+ {
+ $body = $request->body;
+ if (is_string($body)) {
+ return $body;
+ }
+ if (is_array($body)) {
+ return json_encode($body);
+ }
+ return implode(" ", $body);
+ }
+
+ public function decode($data)
+ {
+ return $data;
+ }
+}
|