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

api-platform / core / 14635100171

24 Apr 2025 06:39AM UTC coverage: 8.271% (+0.02%) from 8.252%
14635100171

Pull #6904

github

web-flow
Merge c9cefd82e into a3e5e53ea
Pull Request #6904: feat(graphql): added support for graphql subscriptions to work for actions

0 of 73 new or added lines in 3 files covered. (0.0%)

1999 existing lines in 144 files now uncovered.

13129 of 158728 relevant lines covered (8.27%)

13.6 hits per line

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

55.0
/src/OpenApi/Model/Parameter.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\Model;
15

16
final class Parameter
17
{
18
    use ExtensionTrait;
19

20
    public function __construct(private string $name, private string $in, private string $description = '', private bool $required = false, private bool $deprecated = false, private bool $allowEmptyValue = false, private array $schema = [], private ?string $style = null, private bool $explode = false, private bool $allowReserved = false, private $example = null, private ?\ArrayObject $examples = null, private ?\ArrayObject $content = null)
21
    {
22
        if (null === $style) {
263✔
23
            if ('query' === $in || 'cookie' === $in) {
263✔
24
                $this->style = 'form';
263✔
25
            } elseif ('path' === $in || 'header' === $in) {
30✔
26
                $this->style = 'simple';
30✔
27
            }
28
        }
29
    }
30

31
    public function getName(): string
32
    {
33
        return $this->name;
167✔
34
    }
35

36
    public function getIn(): string
37
    {
38
        return $this->in;
32✔
39
    }
40

41
    public function getDescription(): string
42
    {
43
        return $this->description;
167✔
44
    }
45

46
    public function getRequired(): bool
47
    {
48
        return $this->required;
167✔
49
    }
50

51
    public function getDeprecated(): bool
52
    {
53
        return $this->deprecated;
32✔
54
    }
55

56
    public function canAllowEmptyValue(): bool
57
    {
58
        return $this->allowEmptyValue;
×
59
    }
60

61
    public function getAllowEmptyValue(): bool
62
    {
63
        return $this->allowEmptyValue;
53✔
64
    }
65

66
    public function getSchema(): array
67
    {
68
        return $this->schema;
167✔
69
    }
70

71
    public function getStyle(): string
72
    {
73
        return $this->style;
32✔
74
    }
75

76
    public function canExplode(): bool
77
    {
78
        return $this->explode;
×
79
    }
80

81
    public function getExplode(): bool
82
    {
83
        return $this->explode;
32✔
84
    }
85

86
    public function canAllowReserved(): bool
87
    {
88
        return $this->allowReserved;
×
89
    }
90

91
    public function getAllowReserved(): bool
92
    {
93
        return $this->allowReserved;
32✔
94
    }
95

96
    public function getExample()
97
    {
98
        return $this->example;
32✔
99
    }
100

101
    public function getExamples(): ?\ArrayObject
102
    {
103
        return $this->examples;
32✔
104
    }
105

106
    public function getContent(): ?\ArrayObject
107
    {
108
        return $this->content;
32✔
109
    }
110

111
    public function withName(string $name): self
112
    {
UNCOV
113
        $clone = clone $this;
12✔
UNCOV
114
        $clone->name = $name;
12✔
115

UNCOV
116
        return $clone;
12✔
117
    }
118

119
    public function withIn(string $in): self
120
    {
121
        $clone = clone $this;
×
122
        $clone->in = $in;
×
123

124
        return $clone;
×
125
    }
126

127
    public function withDescription(string $description): self
128
    {
129
        $clone = clone $this;
14✔
130
        $clone->description = $description;
14✔
131

132
        return $clone;
14✔
133
    }
134

135
    public function withRequired(bool $required): self
136
    {
UNCOV
137
        $clone = clone $this;
12✔
UNCOV
138
        $clone->required = $required;
12✔
139

UNCOV
140
        return $clone;
12✔
141
    }
142

143
    public function withDeprecated(bool $deprecated): self
144
    {
145
        $clone = clone $this;
×
146
        $clone->deprecated = $deprecated;
×
147

148
        return $clone;
×
149
    }
150

151
    public function withAllowEmptyValue(bool $allowEmptyValue): self
152
    {
UNCOV
153
        $clone = clone $this;
12✔
UNCOV
154
        $clone->allowEmptyValue = $allowEmptyValue;
12✔
155

UNCOV
156
        return $clone;
12✔
157
    }
158

159
    public function withSchema(array $schema): self
160
    {
161
        $clone = clone $this;
18✔
162
        $clone->schema = $schema;
18✔
163

164
        return $clone;
18✔
165
    }
166

167
    public function withStyle(string $style): self
168
    {
169
        $clone = clone $this;
×
170
        $clone->style = $style;
×
171

172
        return $clone;
×
173
    }
174

175
    public function withExplode(bool $explode): self
176
    {
177
        $clone = clone $this;
×
178
        $clone->explode = $explode;
×
179

180
        return $clone;
×
181
    }
182

183
    public function withAllowReserved(bool $allowReserved): self
184
    {
185
        $clone = clone $this;
×
186
        $clone->allowReserved = $allowReserved;
×
187

188
        return $clone;
×
189
    }
190

191
    public function withExample($example): self
192
    {
193
        $clone = clone $this;
×
194
        $clone->example = $example;
×
195

196
        return $clone;
×
197
    }
198

199
    public function withExamples(\ArrayObject $examples): self
200
    {
201
        $clone = clone $this;
×
202
        $clone->examples = $examples;
×
203

204
        return $clone;
×
205
    }
206

207
    public function withContent(\ArrayObject $content): self
208
    {
209
        $clone = clone $this;
×
210
        $clone->content = $content;
×
211

212
        return $clone;
×
213
    }
214
}
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

© 2025 Coveralls, Inc