Skip to content

Commit

Permalink
Merge branch '4.x' into patch-phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
l0gicgate committed May 6, 2020
2 parents c697eb0 + 212c00e commit 88fe329
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Slim/Middleware/BodyParsingMiddleware.php
Expand Up @@ -102,7 +102,7 @@ public function getBodyParser(string $mediaType): callable

protected function registerDefaultBodyParsers(): void
{
$this->registerBodyParser('application/json', function ($input) {
$this->registerBodyParser('application/json', static function ($input) {
$result = json_decode($input, true);

if (!is_array($result)) {
Expand All @@ -112,12 +112,12 @@ protected function registerDefaultBodyParsers(): void
return $result;
});

$this->registerBodyParser('application/x-www-form-urlencoded', function ($input) {
$this->registerBodyParser('application/x-www-form-urlencoded', static function ($input) {
parse_str($input, $data);
return $data;
});

$xmlCallable = function ($input) {
$xmlCallable = static function ($input) {
$backup = libxml_disable_entity_loader(true);
$backup_errors = libxml_use_internal_errors(true);
$result = simplexml_load_string($input);
Expand Down

0 comments on commit 88fe329

Please sign in to comment.