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

IlyasDeckers / ody-core / 13532154862

25 Feb 2025 10:24PM UTC coverage: 30.374% (+1.7%) from 28.706%
13532154862

push

github

web-flow
Update php.yml

544 of 1791 relevant lines covered (30.37%)

9.13 hits per line

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

0.0
/src/Http/JsonResponse.php
1
<?php
2
namespace Ody\Core\Http;
3

4
use Nyholm\Psr7\Response as Psr7Response;
5

6
class JsonResponse
7
{
8
    private static function response(int $statusCode, $data = null): Psr7Response
×
9
    {
10
        $body = $data ? json_encode($data) : '';
×
11

12
        return new Psr7Response(
×
13
            $statusCode, ['Content-Type' => 'application/json'], $body
×
14
        );
×
15
    }
16
    public static function ok($data): Psr7Response
×
17
    {
18
        return self::response(200, $data);
×
19
    }
20

21
    public static function notFound($data): Psr7Response
×
22
    {
23
        return self::response(404, $data);
×
24
    }
25
}
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