Skip to content

Commit 791b577

Browse files
committed
Added parsedBody method
1 parent 8b0951f commit 791b577

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Request.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,18 @@ public function getParsedBody()
336336
return $this->parsedBody;
337337
}
338338

339+
/**
340+
* @param string $key
341+
* @param mixed|null $default
342+
*
343+
* @return mixed|null
344+
*/
345+
public function parsedBody(string $key, $default = null)
346+
{
347+
$parseBody = $this->getParsedBody();
348+
return $parseBody[$key] ?? $default;
349+
}
350+
339351
/**
340352
* add parser body
341353
*

0 commit comments

Comments
 (0)