PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.17.0
GiveWP – Donation Plugin and Fundraising Platform v4.17.0
4.17.0 4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 All 256 releases
give / vendor / paypal / paypalhttp / lib / PayPalHttp / Serializer / Text.php

Text.php in GiveWP – Donation Plugin and Fundraising Platform 4.17.0, at vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Text.php

39 lines 656 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace PayPalHttp\Serializer;
4
5 use PayPalHttp\HttpRequest;
6 use PayPalHttp\Serializer;
7
8 /**
9 * Class Text
10 * @package PayPalHttp\Serializer
11 *
12 * Serializer for Text content types.
13 */
14 class Text implements Serializer
15 {
16
17 public function contentType()
18 {
19 return "/^text\\/.*/";
20 }
21
22 public function encode(HttpRequest $request)
23 {
24 $body = $request->body;
25 if (is_string($body)) {
26 return $body;
27 }
28 if (is_array($body)) {
29 return json_encode($body);
30 }
31 return implode(" ", $body);
32 }
33
34 public function decode($data)
35 {
36 return $data;
37 }
38 }
39