mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-21 08:40:08 +01:00
Summary: Adds the Balanced PHP API to externals/. Ref T2787. Test Plan: Used in next diff. Reviewers: btrahan, chad Reviewed By: chad CC: aran, aurelijus Maniphest Tasks: T2787 Differential Revision: https://secure.phabricator.com/D5764
30 lines
No EOL
550 B
PHP
30 lines
No EOL
550 B
PHP
<?php
|
|
/**
|
|
* Mime Type: application/x-www-urlencoded
|
|
* @author Nathan Good <me@nategood.com>
|
|
*/
|
|
|
|
namespace Httpful\Handlers;
|
|
|
|
class FormHandler extends MimeHandlerAdapter
|
|
{
|
|
/**
|
|
* @param string $body
|
|
* @return mixed
|
|
*/
|
|
public function parse($body)
|
|
{
|
|
$parsed = array();
|
|
parse_str($body, $parsed);
|
|
return $parsed;
|
|
}
|
|
|
|
/**
|
|
* @param mixed $payload
|
|
* @return string
|
|
*/
|
|
public function serialize($payload)
|
|
{
|
|
return http_build_query($payload, null, '&');
|
|
}
|
|
} |