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

tempestphp / tempest-framework / 14135266123

28 Mar 2025 06:12PM UTC coverage: 80.717%. First build
14135266123

Pull #1093

github

web-flow
Merge 07f559c93 into 82efd6090
Pull Request #1093: feat(router): support getting raw body from requests

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

10942 of 13556 relevant lines covered (80.72%)

101.05 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