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

DoclerLabs / api-client-generator / 21433352645

28 Jan 2026 09:50AM UTC coverage: 86.69% (-0.3%) from 86.973%
21433352645

push

github

web-flow
Merge pull request #131 from DoclerLabs/dependabot/composer/phpunit/phpunit-9.6.33

Bump phpunit/phpunit from 9.5.9 to 9.6.33

3465 of 3997 relevant lines covered (86.69%)

7.11 hits per line

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

40.0
/src/Entity/Response.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace DoclerLabs\ApiClientGenerator\Entity;
6

7
use DoclerLabs\ApiClientGenerator\Input\InvalidSpecificationException;
8
use DoclerLabs\ApiClientGenerator\Output\Copy\Serializer\ContentType\FormUrlencodedContentTypeSerializer;
9
use DoclerLabs\ApiClientGenerator\Output\Copy\Serializer\ContentType\JsonContentTypeSerializer;
10
use DoclerLabs\ApiClientGenerator\Output\Copy\Serializer\ContentType\VdnApiJsonContentTypeSerializer;
11
use DoclerLabs\ApiClientGenerator\Output\Copy\Serializer\ContentType\XmlContentTypeSerializer;
12

13
class Response
14
{
15
    private const ALLOWED_CONTENT_TYPES = [
16
        JsonContentTypeSerializer::MIME_TYPE,
17
        FormUrlencodedContentTypeSerializer::MIME_TYPE,
18
        XmlContentTypeSerializer::MIME_TYPE,
19
        VdnApiJsonContentTypeSerializer::MIME_TYPE,
20
    ];
21

22
    public function __construct(
23
        public readonly int $statusCode,
24
        public readonly ?Field $body = null,
25
        public readonly array $bodyContentTypes = []
26
    ) {
27
        $unsupportedContentTypes = array_diff($bodyContentTypes, self::ALLOWED_CONTENT_TYPES);
3✔
28
        if (!empty($unsupportedContentTypes)) {
3✔
29
            throw new InvalidSpecificationException(
×
30
                sprintf('Response content-type %s is not currently supported.', json_encode($unsupportedContentTypes))
×
31
            );
×
32
        }
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