Format and return the payload

@param $payload
@return string
516846
public function format($payload)
    {
        $payload = $this->fill($payload);
        return "[".$payload['responsecode']."] ".$payload['message']."<br />".$payload['verbosemessage']."<br/>".$payload['url'];

    }
213239
public function decrypt($payload)
    {
        $payload = $this->_getJsonPayload($payload);
        $iv = base64_decode($payload['iv']);
        $decrypted = openssl_decrypt($payload['value'], $this->_cipher, $this->_key, 0, $iv);

        if ($decrypted === false) {
            throw new AnEncrypterException('Could not decrypt the data.');
        }

        return unserialize($decrypted);
    }
481823
public function encode(array $payload)
    {
        try {
            $this->jws->setPayload($payload)->sign($this->getSigningKey(), $this->getPassphrase());

            return (string) $this->jws->getTokenString();
        } catch (Exception $e) {
            throw new JwTException('Could not create token: '.$e->getMessage(), $e->getCode(), $e);
        }
    }
982784
public function getPayload($request = null)
    {
        if (!$request) {
            return $this->_payload;
        }

        $payload = null;

        $token = $this->getToken($request);
        if ($token) {
            $payload = $this->_decode($token);
        }

        return $this->_payload = $payload;
    }
96372
public function search($payload)
    {
        $query = $this->model->orderBy('created_at', 'desc');
        $query->where('id', 'LIKE', '%'.$payload['term'].'%');

        $columns = Schema::getColumnListing($this->table);

        foreach ($columns as $attribute) {
            $query->orWhere($attribute, 'LIKE', '%'.$payload['term'].'%');
        }

        return [$query, $payload['term'], $query->paginate(25)->render()];
    }
1245921
public function parse($payload)
    {
        if (function_exists('MongoDB\BSON\toPHP') && ! function_exists('bson_decode')) {
            require_once(__DIR__ . '/BSONPolyfill.php');  //@codeCoverageIgnore
        } elseif ( ! (function_exists('bson_decode') || function_exists('MongoDB\BSON\toPHP'))) {
            throw new ParserException('Failed To Parse BSON - Supporting Library Not Available');  // @codeCoverageIgnore
        }

        if ($payload) {
            $prevHandler = set_error_handler(function ($errno, $errstr, $errfile, $errline, $errcontext) {
                throw new \Exception($errstr);  // @codeCoverageIgnore
            });

            try {
                $bson = bson_decode(trim($payload, " \t\n\r\x0b"));  // Don't trim \0, as it has valid meaning in BSON
                if ( ! $bson) {
                    throw new \Exception('Unknown error');  // @codeCoverageIgnore
                }
            } catch (\Exception $e) {
                set_error_handler($prevHandler);
                throw new ParserException('Failed To Parse BSON - ' . $e->getMessage());
            }

            set_error_handler($prevHandler);

            return $bson;
        }

        return [];
    }
1356439
private static function getJsonPayload($payload)
    {
        $payload = json_decode(base64_decode($payload), true);
        if (! $payload || self::isInvalidPayload($payload)) {
            throw new Exceptions\DecryptionException('The payload is invalid.');
        }

        return $payload;
    }
498260
private function extractJobName($payload)
	{
		$payload = json_decode($payload, true);

		if ($payload && (! isset($payload['data']['command']))) {
			return Arr::get($payload, 'job');
		}

		if ($payload && isset($payload['data']['command'])) {
			preg_match('/"([^"]+)"/', $payload['data']['command'], $matches);

			if (isset($matches[1])) {
				return $matches[1];
			} else {
				return Arr::get($payload, 'job');
			}
		}
	}
30507
public function body($payload)
    {
        if (!empty($payload) || is_array($payload)) {
            $this->payload = $payload;
        }

        return $this;
    }
375616
private static function serializePayload($payload = '') : string
    {
        // If the payload is already JSON, return it
        if (\is_string($payload)) {
            return $payload;
        }

        $data = '';

        if (!empty($payload)) {
            $data = \json_encode($payload, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRESERVE_ZERO_FRACTION);
        }

        return $data;
    }
49925
public function format(string $message): string
    {
        if (null === $this->params) {
            return $message;
        }

        foreach ($this->transformParams($this->params) as $key => $value) {
            $message = str_replace($key, $value, $message);
        }

        return $message;
    }
1093595
private static function preprocessJsonPayload($payload) {

        $requests = [];

        $is_batch = false;

        if ( is_array($payload) ) {

            $is_batch = true;

            foreach ( $payload as $request ) $requests[] = self::preprocessJsonRequest($request);

        } else {

            $requests[] = self::preprocessJsonRequest($payload);

        }

        return array($is_batch, $requests);

    }
1171980
public static function unserializeMessagePayload($payload)
    {
        $message = json_decode($payload, true);
        if (json_last_error() === JSON_ERROR_NONE) {
            return $message;
        }

        return $payload;
    }
1262829
public function setPayload($payload)
    {
        $this->payload = $payload;

        $this->setPayloadType(gettype($payload));

        if ($payload instanceof EntityDataModel) {
            $this->setPayloadType("EntityDataModel");
        }

        if ($payload instanceof EntityCollection) {
            $this->setPayloadType("EntityCollection");
            if ($payload->isPaginated()) {
                $this->setPayloadMeta([
                    'total' => $payload->getOriginalCount(),
                    'returned' => $payload->getCount(),
                    'page' => $payload->getPage(),
                    'perPage' => $payload->getPerPage()
                ]);
            }
        }

        return $this;
    }
322627
public function validPayload($payload)
    {
        return is_array($payload) && isset($payload['iv'], $payload['value'], $payload['mac']) &&
               strlen(base64_decode($payload['iv'], true)) === openssl_cipher_iv_length($this->cipher);
    }
958193
function formatBytes($bytes)
    {
        $bytes = floatval($bytes);
        $arBytes = array(
            0 => array(
                "UNIT" => "TB",
                "VALUE" => pow(1024, 4)
            ),
            1 => array(
                "UNIT" => "GB",
                "VALUE" => pow(1024, 3)
            ),
            2 => array(
                "UNIT" => "MB",
                "VALUE" => pow(1024, 2)
            ),
            3 => array(
                "UNIT" => "KB",
                "VALUE" => 1024
            ),
            4 => array(
                "UNIT" => "B",
                "VALUE" => 1
            ),
        );

        foreach($arBytes as $arItem)
        {
            if($bytes >= $arItem["VALUE"])
            {
                $result = $bytes / $arItem["VALUE"];
                $result = str_replace(".", "," , strval(round($result, 2)))." ".$arItem["UNIT"];
                break;
            }
        }
        return $result;
    }
497758
public static function get($payload)
    {
        switch ($payload) {
            case 'OK':
            case 'QUEUED':
                if (isset(self::$$payload)) {
                    return self::$$payload;
                }

                return self::$$payload = new self($payload);

            default:
                return new self($payload);
        }
    }