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

api-platform / core / 21001095414

14 Jan 2026 04:10PM UTC coverage: 0.0% (-29.1%) from 29.095%
21001095414

Pull #7595

github

web-flow
Merge 620cc601d into 73402fc61
Pull Request #7595: feat: mcp bundle tool integration

0 of 476 new or added lines in 16 files covered. (0.0%)

15042 existing lines in 491 files now uncovered.

0 of 58241 relevant lines covered (0.0%)

0.0 hits per line

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

0.0
/src/Metadata/McpResource.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\Metadata;
15

16
use ApiPlatform\Metadata\Exception\ProblemExceptionInterface;
17
use ApiPlatform\OpenApi\Attributes\Webhook;
18
use ApiPlatform\OpenApi\Model\Operation as OpenApiOperation;
19
use ApiPlatform\State\OptionsInterface;
20
use Symfony\Component\WebLink\Link as WebLink;
21

22
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
23
final class McpResource extends HttpOperation
24
{
25
    /**
26
     * @param string                                         $uri           The specific URI identifying this resource instance. Must be unique within the server.
27
     * @param ?string                                        $name          A human-readable name for this resource. If null, a default might be generated from the method name.
28
     * @param ?string                                        $description   An optional description of the resource. Defaults to class DocBlock summary.
29
     * @param ?string                                        $mimeType      the MIME type, if known and constant for this resource
30
     * @param ?int                                           $size          the size in bytes, if known and constant
31
     * @param mixed|null                                     $annotations   optional annotations describing the resource
32
     * @param array|null                                     $icons         Optional list of icon URLs representing the resource
33
     * @param array<string, mixed>|null                      $meta          Optional metadata
34
     * @param string[]|null                                  $types         the RDF types of this property
35
     * @param array<int|string, string|string[]>|string|null $formats       {@see https://api-platform.com/docs/core/content-negotiation/#configuring-formats-for-a-specific-resource-or-operation}
36
     * @param array<int|string, string|string[]>|string|null $inputFormats  {@see https://api-platform.com/docs/core/content-negotiation/#configuring-formats-for-a-specific-resource-or-operation}
37
     * @param array<int|string, string|string[]>|string|null $outputFormats {@see https://api-platform.com/docs/core/content-negotiation/#configuring-formats-for-a-specific-resource-or-operation}
38
     * @param array<string,array{
39
     *     0: string,
40
     *     1: string
41
     * }|array{
42
     *     from_property?: string,
43
     *     to_property?: string,
44
     *     from_class?: string,
45
     *     to_class?: string,
46
     *     identifiers?: string[],
47
     *     composite_identifier?: bool,
48
     *     expanded_value?: string,
49
     * }|Link>|string[]|string|null $uriVariables {@see https://api-platform.com/docs/core/subresources/}
50
     * @param string|null     $routePrefix {@see https://api-platform.com/docs/core/operations/#prefixing-all-routes-of-all-operations}
51
     * @param string|null     $sunset      {@see https://api-platform.com/docs/core/deprecations/#setting-the-sunset-http-header-to-indicate-when-a-resource-or-an-operation-will-be-removed}
52
     * @param string|int|null $status      {@see https://api-platform.com/docs/core/operations/#configuring-operations}
53
     * @param array{
54
     *     max_age?: int,
55
     *     vary?: string|string[],
56
     *     public?: bool,
57
     *     shared_max_age?: int,
58
     *     stale_while_revalidate?: int,
59
     *     stale_if_error?: int,
60
     *     must_revalidate?: bool,
61
     *     proxy_revalidate?: bool,
62
     *     no_cache?: bool,
63
     *     no_store?: bool,
64
     *     no_transform?: bool,
65
     *     immutable?: bool,
66
     * }|null $cacheHeaders {@see https://api-platform.com/docs/core/performance/#setting-custom-http-cache-headers}
67
     * @param array<string, string>|null $headers
68
     * @param list<array{
69
     *     field: string,
70
     *     direction: string,
71
     * }>|null $paginationViaCursor {@see https://api-platform.com/docs/core/pagination/#cursor-based-pagination}
72
     * @param array|null $normalizationContext   {@see https://api-platform.com/docs/core/serialization/#using-serialization-groups}
73
     * @param array|null $denormalizationContext {@see https://api-platform.com/docs/core/serialization/#using-serialization-groups}
74
     * @param array|null $hydraContext           {@see https://api-platform.com/docs/core/extending-jsonld-context/#hydra}
75
     * @param array{
76
     *     class?: string|null,
77
     *     name?: string,
78
     * }|string|false|null $input {@see https://api-platform.com/docs/core/dto/#specifying-an-input-or-an-output-data-representation}
79
     * @param array{
80
     *     class?: string|null,
81
     *     name?: string,
82
     * }|string|false|null $output {@see https://api-platform.com/docs/core/dto/#specifying-an-input-or-an-output-data-representation}
83
     * @param string|array|bool|null                              $mercure   {@see https://api-platform.com/docs/core/mercure}
84
     * @param string|bool|null                                    $messenger {@see https://api-platform.com/docs/core/messenger/#dispatching-a-resource-through-the-message-bus}
85
     * @param string|callable|null                                $provider  {@see https://api-platform.com/docs/core/state-providers/#state-providers}
86
     * @param string|callable|null                                $processor {@see https://api-platform.com/docs/core/state-processors/#state-processors}
87
     * @param WebLink[]|null                                      $links
88
     * @param array<class-string<ProblemExceptionInterface>>|null $errors
89
     */
90
    public function __construct(
91
        protected string $uri,
92
        ?string $name = null,
93
        ?string $description = null,
94
        protected ?string $mimeType = null,
95
        protected ?int $size = null,
96
        protected mixed $annotations = null,
97
        protected ?array $icons = null,
98
        protected ?array $meta = null,
99

100
        string $method = self::METHOD_GET,
101
        ?string $uriTemplate = null,
102
        ?array $types = null,
103
        $formats = null,
104
        $inputFormats = null,
105
        $outputFormats = null,
106
        $uriVariables = null,
107
        ?string $routePrefix = null,
108
        ?string $routeName = null,
109
        ?array $defaults = null,
110
        ?array $requirements = null,
111
        ?array $options = null,
112
        ?bool $stateless = null,
113
        ?string $sunset = null,
114
        ?string $acceptPatch = null,
115
        $status = null,
116
        ?string $host = null,
117
        ?array $schemes = null,
118
        ?string $condition = null,
119
        ?string $controller = null,
120
        ?array $headers = null,
121
        ?array $cacheHeaders = null,
122
        ?array $paginationViaCursor = null,
123
        ?array $hydraContext = null,
124
        bool|OpenApiOperation|Webhook|null $openapi = null,
125
        ?array $exceptionToStatus = null,
126
        ?array $links = null,
127
        ?array $errors = null,
128
        ?bool $strictQueryParameterValidation = null,
129
        ?bool $hideHydraOperation = null,
130

131
        ?string $shortName = null,
132
        ?string $class = null,
133
        ?bool $paginationEnabled = null,
134
        ?string $paginationType = null,
135
        ?int $paginationItemsPerPage = null,
136
        ?int $paginationMaximumItemsPerPage = null,
137
        ?bool $paginationPartial = null,
138
        ?bool $paginationClientEnabled = null,
139
        ?bool $paginationClientItemsPerPage = null,
140
        ?bool $paginationClientPartial = null,
141
        ?bool $paginationFetchJoinCollection = null,
142
        ?bool $paginationUseOutputWalkers = null,
143
        ?array $order = null,
144
        ?array $normalizationContext = null,
145
        ?array $denormalizationContext = null,
146
        ?bool $collectDenormalizationErrors = null,
147
        string|\Stringable|null $security = null,
148
        ?string $securityMessage = null,
149
        string|\Stringable|null $securityPostDenormalize = null,
150
        ?string $securityPostDenormalizeMessage = null,
151
        string|\Stringable|null $securityPostValidation = null,
152
        ?string $securityPostValidationMessage = null,
153
        ?string $deprecationReason = null,
154
        ?array $filters = null,
155
        ?array $validationContext = null,
156
        $input = null,
157
        $output = null,
158
        $mercure = null,
159
        $messenger = null,
160
        ?int $urlGenerationStrategy = null,
161
        ?bool $read = null,
162
        ?bool $deserialize = null,
163
        ?bool $validate = null,
164
        ?bool $write = null,
165
        ?bool $serialize = null,
166
        ?bool $fetchPartial = null,
167
        ?bool $forceEager = null,
168
        ?int $priority = null,
169
        $provider = null,
170
        $processor = null,
171
        ?OptionsInterface $stateOptions = null,
172
        ?Parameters $parameters = null,
173
        array|string|null $rules = null,
174
        ?string $policy = null,
175
        array|string|null $middleware = null,
176
        ?bool $queryParameterValidationEnabled = null,
177
        ?bool $jsonStream = null,
178
        array $extraProperties = [],
179
        ?bool $map = null,
180
    ) {
NEW
181
        parent::__construct(
×
NEW
182
            method: $method,
×
NEW
183
            uriTemplate: $uriTemplate,
×
NEW
184
            types: $types,
×
NEW
185
            formats: $formats,
×
NEW
186
            inputFormats: $inputFormats,
×
NEW
187
            outputFormats: $outputFormats,
×
NEW
188
            uriVariables: $uriVariables,
×
NEW
189
            routePrefix: $routePrefix,
×
NEW
190
            routeName: $routeName,
×
NEW
191
            defaults: $defaults,
×
NEW
192
            requirements: $requirements,
×
NEW
193
            options: $options,
×
NEW
194
            stateless: $stateless,
×
NEW
195
            sunset: $sunset,
×
NEW
196
            acceptPatch: $acceptPatch,
×
NEW
197
            status: $status,
×
NEW
198
            host: $host,
×
NEW
199
            schemes: $schemes,
×
NEW
200
            condition: $condition,
×
NEW
201
            controller: $controller,
×
NEW
202
            headers: $headers,
×
NEW
203
            cacheHeaders: $cacheHeaders,
×
NEW
204
            paginationViaCursor: $paginationViaCursor,
×
NEW
205
            hydraContext: $hydraContext,
×
NEW
206
            openapi: $openapi,
×
NEW
207
            exceptionToStatus: $exceptionToStatus,
×
NEW
208
            links: $links,
×
NEW
209
            errors: $errors,
×
NEW
210
            strictQueryParameterValidation: $strictQueryParameterValidation,
×
NEW
211
            hideHydraOperation: $hideHydraOperation,
×
NEW
212
            shortName: $shortName,
×
NEW
213
            class: $class,
×
NEW
214
            paginationEnabled: $paginationEnabled,
×
NEW
215
            paginationType: $paginationType,
×
NEW
216
            paginationItemsPerPage: $paginationItemsPerPage,
×
NEW
217
            paginationMaximumItemsPerPage: $paginationMaximumItemsPerPage,
×
NEW
218
            paginationPartial: $paginationPartial,
×
NEW
219
            paginationClientEnabled: $paginationClientEnabled,
×
NEW
220
            paginationClientItemsPerPage: $paginationClientItemsPerPage,
×
NEW
221
            paginationClientPartial: $paginationClientPartial,
×
NEW
222
            paginationFetchJoinCollection: $paginationFetchJoinCollection,
×
NEW
223
            paginationUseOutputWalkers: $paginationUseOutputWalkers,
×
NEW
224
            order: $order,
×
NEW
225
            description: $description,
×
NEW
226
            normalizationContext: $normalizationContext,
×
NEW
227
            denormalizationContext: $denormalizationContext,
×
NEW
228
            collectDenormalizationErrors: $collectDenormalizationErrors,
×
NEW
229
            security: $security,
×
NEW
230
            securityMessage: $securityMessage,
×
NEW
231
            securityPostDenormalize: $securityPostDenormalize,
×
NEW
232
            securityPostDenormalizeMessage: $securityPostDenormalizeMessage,
×
NEW
233
            securityPostValidation: $securityPostValidation,
×
NEW
234
            securityPostValidationMessage: $securityPostValidationMessage,
×
NEW
235
            deprecationReason: $deprecationReason,
×
NEW
236
            filters: $filters,
×
NEW
237
            validationContext: $validationContext,
×
NEW
238
            input: $input,
×
NEW
239
            output: $output,
×
NEW
240
            mercure: $mercure,
×
NEW
241
            messenger: $messenger,
×
NEW
242
            urlGenerationStrategy: $urlGenerationStrategy,
×
NEW
243
            read: $read,
×
NEW
244
            deserialize: $deserialize,
×
NEW
245
            validate: $validate,
×
NEW
246
            write: $write,
×
NEW
247
            serialize: $serialize,
×
NEW
248
            fetchPartial: $fetchPartial,
×
NEW
249
            forceEager: $forceEager,
×
NEW
250
            priority: $priority,
×
NEW
251
            name: $name,
×
NEW
252
            provider: $provider,
×
NEW
253
            processor: $processor,
×
NEW
254
            stateOptions: $stateOptions,
×
NEW
255
            parameters: $parameters,
×
NEW
256
            rules: $rules,
×
NEW
257
            policy: $policy,
×
NEW
258
            middleware: $middleware,
×
NEW
259
            queryParameterValidationEnabled: $queryParameterValidationEnabled,
×
NEW
260
            jsonStream: $jsonStream,
×
NEW
261
            extraProperties: $extraProperties,
×
NEW
262
            map: $map,
×
NEW
263
        );
×
264
    }
265

266
    public function getUri(): string
267
    {
NEW
268
        return $this->uri;
×
269
    }
270

271
    public function withUri(string $uri): static
272
    {
NEW
273
        $self = clone $this;
×
NEW
274
        $self->uri = $uri;
×
275

NEW
276
        return $self;
×
277
    }
278

279
    public function getMimeType(): ?string
280
    {
NEW
281
        return $this->mimeType;
×
282
    }
283

284
    public function withMimeType(?string $mimeType): static
285
    {
NEW
286
        $self = clone $this;
×
NEW
287
        $self->mimeType = $mimeType;
×
288

NEW
289
        return $self;
×
290
    }
291

292
    public function getSize(): ?int
293
    {
NEW
294
        return $this->size;
×
295
    }
296

297
    public function withSize(?int $size): static
298
    {
NEW
299
        $self = clone $this;
×
NEW
300
        $self->size = $size;
×
301

NEW
302
        return $self;
×
303
    }
304

305
    public function getAnnotations(): mixed
306
    {
NEW
307
        return $this->annotations;
×
308
    }
309

310
    public function withAnnotations(mixed $annotations): static
311
    {
NEW
312
        $self = clone $this;
×
NEW
313
        $self->annotations = $annotations;
×
314

NEW
315
        return $self;
×
316
    }
317

318
    public function getIcons(): ?array
319
    {
NEW
320
        return $this->icons;
×
321
    }
322

323
    public function withIcons(?array $icons): static
324
    {
NEW
325
        $self = clone $this;
×
NEW
326
        $self->icons = $icons;
×
327

NEW
328
        return $self;
×
329
    }
330

331
    public function getMeta(): ?array
332
    {
NEW
333
        return $this->meta;
×
334
    }
335

336
    public function withMeta(?array $meta): static
337
    {
NEW
338
        $self = clone $this;
×
NEW
339
        $self->meta = $meta;
×
340

NEW
341
        return $self;
×
342
    }
343
}
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