• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tempestphp / tempest-framework / 14218827500

02 Apr 2025 11:46AM UTC coverage: 81.07%. First build
14218827500

Pull #1093

github

web-flow
Merge 97f030562 into 78273ccc2
Pull Request #1093: feat(router): support getting raw body from requests

12 of 13 new or added lines in 3 files covered. (92.31%)

11178 of 13788 relevant lines covered (81.07%)

103.41 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Tempest/Router/src/Input/StdinInputStream.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Tempest\Router\Input;
6

7
use function Tempest\Support\str;
8

9
final class StdinInputStream implements InputStream
10
{
11
    public function parse(): array
×
12
    {
13
        $input = file_get_contents('php://input');
×
14

15
        if (json_validate($input)) {
×
NEW
16
            return json_decode($input, associative: true);
×
17
        }
18

19
        $inputStreamData = str($input)
×
20
            ->explode('&')
×
21
            ->mapWithKeys(function (string $item) {
×
22
                $parts = explode('=', $item, 2);
×
23

24
                $key = $parts[0];
×
25

26
                $value = $_POST[str_replace('.', '_', $key)] ?? $parts[1] ?? '';
×
27

28
                yield $key => $value;
×
29
            })
×
30
            ->toArray();
×
31

32
        return $_POST + $inputStreamData;
×
33
    }
34
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc