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

api-platform / core / 13203378522

07 Feb 2025 03:56PM UTC coverage: 8.501% (+0.7%) from 7.837%
13203378522

push

github

soyuka
Merge 4.1

111 of 490 new or added lines in 51 files covered. (22.65%)

5590 existing lines in 163 files now uncovered.

13345 of 156987 relevant lines covered (8.5%)

22.88 hits per line

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

87.5
/src/OpenApi/Options.php
1
<?php
2

3
/*
4
 * This file is part of the API Platform project.
5
 *
6
 * (c) Kévin Dunglas <dunglas@gmail.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
declare(strict_types=1);
13

14
namespace ApiPlatform\OpenApi;
15

16
use ApiPlatform\OpenApi\Model\Tag;
17

18
final readonly class Options
19
{
20
    /**
21
     * @param Tag[]        $tags
22
     * @param class-string $errorResourceClass
23
     * @param class-string $validationErrorResourceClass
24
     */
25
    public function __construct(
26
        private string $title,
27
        private string $description = '',
28
        private string $version = '',
29
        private bool $oAuthEnabled = false,
30
        private ?string $oAuthType = null,
31
        private ?string $oAuthFlow = null,
32
        private ?string $oAuthTokenUrl = null,
33
        private ?string $oAuthAuthorizationUrl = null,
34
        private ?string $oAuthRefreshUrl = null,
35
        private array $oAuthScopes = [],
36
        private array $apiKeys = [],
37
        private ?string $contactName = null,
38
        private ?string $contactUrl = null,
39
        private ?string $contactEmail = null,
40
        private ?string $termsOfService = null,
41
        private ?string $licenseName = null,
42
        private ?string $licenseUrl = null,
43
        private bool $overrideResponses = true,
44
        private bool $persistAuthorization = false,
45
        private array $httpAuth = [],
46
        private array $tags = [],
47
        private ?string $errorResourceClass = null,
48
        private ?string $validationErrorResourceClass = null,
49
    ) {
UNCOV
50
    }
1,727✔
51

52
    public function getTitle(): string
53
    {
54
        return $this->title;
47✔
55
    }
56

57
    public function getDescription(): string
58
    {
59
        return $this->description;
47✔
60
    }
61

62
    public function getVersion(): string
63
    {
64
        return $this->version;
47✔
65
    }
66

67
    public function getOAuthEnabled(): bool
68
    {
69
        return $this->oAuthEnabled;
57✔
70
    }
71

72
    public function getOAuthType(): ?string
73
    {
74
        return $this->oAuthType;
57✔
75
    }
76

77
    public function getOAuthFlow(): ?string
78
    {
79
        return $this->oAuthFlow;
57✔
80
    }
81

82
    public function getOAuthTokenUrl(): ?string
83
    {
84
        return $this->oAuthTokenUrl;
57✔
85
    }
86

87
    public function getOAuthAuthorizationUrl(): ?string
88
    {
89
        return $this->oAuthAuthorizationUrl;
57✔
90
    }
91

92
    public function getOAuthRefreshUrl(): ?string
93
    {
94
        return $this->oAuthRefreshUrl;
47✔
95
    }
96

97
    public function getOAuthScopes(): array
98
    {
99
        return $this->oAuthScopes;
57✔
100
    }
101

102
    public function getApiKeys(): array
103
    {
104
        return $this->apiKeys;
47✔
105
    }
106

107
    public function getHttpAuth(): array
108
    {
109
        return $this->httpAuth;
47✔
110
    }
111

112
    public function getContactName(): ?string
113
    {
114
        return $this->contactName;
×
115
    }
116

117
    public function getContactUrl(): ?string
118
    {
119
        return $this->contactUrl;
47✔
120
    }
121

122
    public function getContactEmail(): ?string
123
    {
UNCOV
124
        return $this->contactEmail;
×
125
    }
126

127
    public function getTermsOfService(): ?string
128
    {
UNCOV
129
        return $this->termsOfService;
47✔
130
    }
131

132
    public function getLicenseName(): ?string
133
    {
UNCOV
134
        return $this->licenseName;
47✔
135
    }
136

137
    public function getLicenseUrl(): ?string
138
    {
UNCOV
139
        return $this->licenseUrl;
×
140
    }
141

142
    public function getOverrideResponses(): bool
143
    {
UNCOV
144
        return $this->overrideResponses;
47✔
145
    }
146

147
    public function hasPersistAuthorization(): bool
148
    {
UNCOV
149
        return $this->persistAuthorization;
26✔
150
    }
151

152
    /**
153
     * @return Tag[]
154
     */
155
    public function getTags(): array
156
    {
NEW
157
        return $this->tags;
47✔
158
    }
159

160
    /**
161
     * @return class-string|null
162
     */
163
    public function getErrorResourceClass(): ?string
164
    {
NEW
165
        return $this->errorResourceClass;
47✔
166
    }
167

168
    /**
169
     * @return class-string|null
170
     */
171
    public function getValidationErrorResourceClass(): ?string
172
    {
NEW
173
        return $this->validationErrorResourceClass;
47✔
174
    }
175
}
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