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

api-platform / core / 18223414080

03 Oct 2025 01:18PM UTC coverage: 0.0% (-22.0%) from 21.956%
18223414080

Pull #7397

github

web-flow
Merge 69d085182 into 0b8237918
Pull Request #7397: fix(jsonschema/jsonld): make `@id` and `@type` properties required only in the JSON-LD schema for output

0 of 18 new or added lines in 2 files covered. (0.0%)

12304 existing lines in 405 files now uncovered.

0 of 53965 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/ApiProperty.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\Util\PropertyInfoToTypeInfoHelper;
17
use Symfony\Component\PropertyInfo\Type as LegacyType;
18
use Symfony\Component\Serializer\Attribute\Context;
19
use Symfony\Component\Serializer\Attribute\Groups;
20
use Symfony\Component\Serializer\Attribute\Ignore;
21
use Symfony\Component\Serializer\Attribute\MaxDepth;
22
use Symfony\Component\Serializer\Attribute\SerializedName;
23
use Symfony\Component\Serializer\Attribute\SerializedPath;
24
use Symfony\Component\TypeInfo\Type;
25

26
/**
27
 * ApiProperty annotation.
28
 *
29
 * @author Kévin Dunglas <dunglas@gmail.com>
30
 */
31
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::TARGET_CLASS_CONSTANT | \Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
32
final class ApiProperty
33
{
34
    private ?array $types;
35
    private ?array $serialize;
36
    private ?Type $nativeType;
37

38
    /**
39
     * @param bool|null                                                                                                                                   $readableLink            https://api-platform.com/docs/core/serialization/#force-iri-with-relations-of-the-same-type-parentchilds-relations
40
     * @param bool|null                                                                                                                                   $writableLink            https://api-platform.com/docs/core/serialization/#force-iri-with-relations-of-the-same-type-parentchilds-relations
41
     * @param bool|null                                                                                                                                   $required                https://api-platform.com/docs/admin/validation/#client-side-validation
42
     * @param bool|null                                                                                                                                   $identifier              https://api-platform.com/docs/core/identifiers/
43
     * @param mixed                                                                                                                                       $example                 https://api-platform.com/docs/core/openapi/#using-the-openapi-and-swagger-contexts
44
     * @param string|null                                                                                                                                 $deprecationReason       https://api-platform.com/docs/core/deprecations/#deprecating-resource-classes-operations-and-properties
45
     * @param bool|null                                                                                                                                   $fetchEager              https://api-platform.com/docs/core/performance/#eager-loading
46
     * @param array|null                                                                                                                                  $jsonldContext           https://api-platform.com/docs/core/extending-jsonld-context/#extending-json-ld-and-hydra-contexts
47
     * @param array|null                                                                                                                                  $openapiContext          https://api-platform.com/docs/core/openapi/#using-the-openapi-and-swagger-contexts
48
     * @param bool|null                                                                                                                                   $push                    https://api-platform.com/docs/core/push-relations/
49
     * @param string|\Stringable|null                                                                                                                     $security                https://api-platform.com/docs/core/security
50
     * @param string|\Stringable|null                                                                                                                     $securityPostDenormalize https://api-platform.com/docs/core/security/#executing-access-control-rules-after-denormalization
51
     * @param string[]|null                                                                                                                               $types                   the RDF types of this property
52
     * @param string[]|null                                                                                                                               $iris
53
     * @param LegacyType[]|null                                                                                                                           $builtinTypes
54
     * @param string|null                                                                                                                                 $uriTemplate             whether to return the subRessource collection IRI instead of an iterable of IRI
55
     * @param string|null                                                                                                                                 $property                The property name
56
     * @param Context|Groups|Ignore|SerializedName|SerializedPath|MaxDepth|array<array-key, Context|Groups|Ignore|SerializedName|SerializedPath|MaxDepth> $serialize               Serializer attributes
57
     * @param Type|null                                                                                                                                   $nativeType              The internal PHP type
58
     */
59
    public function __construct(
60
        private ?string $description = null,
61
        private ?bool $readable = null,
62
        private ?bool $writable = null,
63
        private ?bool $readableLink = null,
64
        private ?bool $writableLink = null,
65
        private ?bool $required = null,
66
        private ?bool $identifier = null,
67
        private mixed $default = null,
68
        private mixed $example = null,
69
        /**
70
         * The `deprecationReason` option deprecates the current operation with a deprecation message.
71
         *
72
         * <div data-code-selector>
73
         *
74
         * ```php
75
         * <?php
76
         * // api/src/Entity/Review.php
77
         * use ApiPlatform\Metadata\ApiProperty;
78
         * use ApiPlatform\Metadata\ApiResource;
79
         *
80
         * #[ApiResource]
81
         * class Review
82
         * {
83
         *     #[ApiProperty(deprecationReason: "Use the rating property instead")]
84
         *     public string $letter;
85
         * }
86
         * ```
87
         *
88
         * ```yaml
89
         * # api/config/api_platform/properties.yaml
90
         * properties:
91
         *     App\Entity\Review:
92
         *         letter:
93
         *             deprecationReason: 'Create a Book instead'
94
         * ```
95
         *
96
         * ```xml
97
         * <?xml version="1.0" encoding="UTF-8" ?>
98
         * <!-- api/config/api_platform/properties.xml -->
99
         *
100
         * <properties
101
         *         xmlns="https://api-platform.com/schema/metadata/properties-3.0"
102
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
103
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/properties-3.0
104
         *         https://api-platform.com/schema/metadata/properties-3.0.xsd">
105
         *     <property resource="App\Entity\Review" name="letter" deprecationReason="Create a Book instead" />
106
         * </properties>
107
         * ```
108
         *
109
         * </div>
110
         *
111
         * - With JSON-lD / Hydra, [an `owl:deprecated` annotation property](https://www.w3.org/TR/owl2-syntax/#Annotation_Properties) will be added to the appropriate data structure
112
         * - With Swagger / OpenAPI, [a `deprecated` property](https://swagger.io/docs/specification/2-0/paths-and-operations/) will be added
113
         * - With GraphQL, the [`isDeprecated` and `deprecationReason` properties](https://facebook.github.io/graphql/June2018/#sec-Deprecation) will be added to the schema
114
         */
115
        private ?string $deprecationReason = null,
116
        private ?bool $fetchable = null,
117
        private ?bool $fetchEager = null,
118
        private ?array $jsonldContext = null,
119
        private ?array $openapiContext = null,
120
        private ?array $jsonSchemaContext = null,
121
        private ?bool $push = null,
122
        /**
123
         * The `security` option defines the access to the current property, on normalization process, based on Symfony Security.
124
         * It receives an `object` variable related to the current object, and a `property` variable related to the current property.
125
         *
126
         * <div data-code-selector>
127
         *
128
         * ```php
129
         * <?php
130
         * // api/src/Entity/Review.php
131
         * use ApiPlatform\Metadata\ApiProperty;
132
         * use ApiPlatform\Metadata\ApiResource;
133
         *
134
         * #[ApiResource]
135
         * class Review
136
         * {
137
         *     #[ApiProperty(security: 'is_granted("ROLE_ADMIN")')]
138
         *     public string $letter;
139
         * }
140
         * ```
141
         *
142
         * ```yaml
143
         * # api/config/api_platform/properties.yaml
144
         * properties:
145
         *     App\Entity\Review:
146
         *         letter:
147
         *             security: 'is_granted("ROLE_ADMIN")'
148
         * ```
149
         *
150
         * ```xml
151
         * <?xml version="1.0" encoding="UTF-8" ?>
152
         * <!-- api/config/api_platform/properties.xml -->
153
         *
154
         * <properties
155
         *         xmlns="https://api-platform.com/schema/metadata/properties-3.0"
156
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
157
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/properties-3.0
158
         *         https://api-platform.com/schema/metadata/properties-3.0.xsd">
159
         *     <property resource="App\Entity\Review" name="letter" security="is_granted('ROLE_ADMIN')" />
160
         * </properties>
161
         * ```
162
         *
163
         * </div>
164
         */
165
        private string|\Stringable|null $security = null,
166
        /**
167
         * The `securityPostDenormalize` option defines access to the current property after the denormalization process, based on Symfony Security.
168
         * It receives an `object` variable related to the current object, and a `property` variable related to the current property.
169
         *
170
         * <div data-code-selector>
171
         *
172
         * ```php
173
         * <?php
174
         * // api/src/Entity/Review.php
175
         * use ApiPlatform\Metadata\ApiProperty;
176
         * use ApiPlatform\Metadata\ApiResource;
177
         *
178
         * #[ApiResource]
179
         * class Review
180
         * {
181
         *     #[ApiProperty(securityPostDenormalize: 'is_granted("ROLE_ADMIN")')]
182
         *     public string $letter;
183
         * }
184
         * ```
185
         *
186
         * ```yaml
187
         * # api/config/api_platform/properties.yaml
188
         * properties:
189
         *     App\Entity\Review:
190
         *         letter:
191
         *             securityPostDenormalize: 'is_granted("ROLE_ADMIN")'
192
         * ```
193
         *
194
         * ```xml
195
         * <?xml version="1.0" encoding="UTF-8" ?>
196
         * <!-- api/config/api_platform/properties.xml -->
197
         *
198
         * <properties
199
         *         xmlns="https://api-platform.com/schema/metadata/properties-3.0"
200
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
201
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/properties-3.0
202
         *         https://api-platform.com/schema/metadata/properties-3.0.xsd">
203
         *     <property resource="App\Entity\Review" name="letter" securityPostDenormalize="is_granted('ROLE_ADMIN')" />
204
         * </properties>
205
         * ```
206
         *
207
         * </div>
208
         */
209
        private string|\Stringable|null $securityPostDenormalize = null,
210
        array|string|null $types = null,
211
        /*
212
         * The related php types.
213
         *
214
         * deprecated since 4.2, use "nativeType" instead.
215
         */
216
        private ?array $builtinTypes = null,
217
        private ?array $schema = null,
218
        private ?bool $initializable = null,
219
        private $iris = null,
220
        private ?bool $genId = null,
221
        private ?string $uriTemplate = null,
222
        private ?string $property = null,
223
        private ?string $policy = null,
224
        array|Context|Groups|Ignore|SerializedName|SerializedPath|MaxDepth|null $serialize = null,
225
        /**
226
         * Whether to document this property as a hydra:supportedProperty.
227
         */
228
        private ?bool $hydra = null,
229
        ?Type $nativeType = null,
230
        private array $extraProperties = [],
231
    ) {
UNCOV
232
        $this->types = \is_string($types) ? (array) $types : $types;
×
UNCOV
233
        $this->serialize = (null === $serialize || \is_array($serialize)) ? $serialize : [$serialize];
×
UNCOV
234
        $this->nativeType = $nativeType;
×
235

UNCOV
236
        if ($this->builtinTypes) {
×
237
            trigger_deprecation('api_platform/metadata', '4.2', \sprintf('The "builtinTypes" argument of "%s" is deprecated, use "nativeType" instead.', __CLASS__));
×
238
            $this->nativeType ??= PropertyInfoToTypeInfoHelper::convertLegacyTypesToType($this->builtinTypes);
×
UNCOV
239
        } elseif ($this->nativeType) {
×
240
            $this->builtinTypes = PropertyInfoToTypeInfoHelper::convertTypeToLegacyTypes($this->nativeType) ?? [];
×
241
        }
242
    }
243

244
    public function getProperty(): ?string
245
    {
UNCOV
246
        return $this->property;
×
247
    }
248

249
    public function withProperty(string $property): static
250
    {
UNCOV
251
        $self = clone $this;
×
UNCOV
252
        $self->property = $property;
×
253

UNCOV
254
        return $self;
×
255
    }
256

257
    public function getDescription(): ?string
258
    {
UNCOV
259
        return $this->description;
×
260
    }
261

262
    public function withDescription(string $description): static
263
    {
UNCOV
264
        $self = clone $this;
×
UNCOV
265
        $self->description = $description;
×
266

UNCOV
267
        return $self;
×
268
    }
269

270
    public function isReadable(): ?bool
271
    {
UNCOV
272
        return $this->readable;
×
273
    }
274

275
    public function withReadable(bool $readable): static
276
    {
UNCOV
277
        $self = clone $this;
×
UNCOV
278
        $self->readable = $readable;
×
279

UNCOV
280
        return $self;
×
281
    }
282

283
    public function isWritable(): ?bool
284
    {
UNCOV
285
        return $this->writable;
×
286
    }
287

288
    public function withWritable(bool $writable): static
289
    {
UNCOV
290
        $self = clone $this;
×
UNCOV
291
        $self->writable = $writable;
×
292

UNCOV
293
        return $self;
×
294
    }
295

296
    public function isReadableLink(): ?bool
297
    {
UNCOV
298
        return $this->readableLink;
×
299
    }
300

301
    public function withReadableLink(bool $readableLink): static
302
    {
UNCOV
303
        $self = clone $this;
×
UNCOV
304
        $self->readableLink = $readableLink;
×
305

UNCOV
306
        return $self;
×
307
    }
308

309
    public function isWritableLink(): ?bool
310
    {
UNCOV
311
        return $this->writableLink;
×
312
    }
313

314
    public function withWritableLink(bool $writableLink): static
315
    {
UNCOV
316
        $self = clone $this;
×
UNCOV
317
        $self->writableLink = $writableLink;
×
318

UNCOV
319
        return $self;
×
320
    }
321

322
    public function isRequired(): ?bool
323
    {
UNCOV
324
        return $this->required;
×
325
    }
326

327
    public function withRequired(bool $required): static
328
    {
UNCOV
329
        $self = clone $this;
×
UNCOV
330
        $self->required = $required;
×
331

UNCOV
332
        return $self;
×
333
    }
334

335
    public function isIdentifier(): ?bool
336
    {
UNCOV
337
        return $this->identifier;
×
338
    }
339

340
    public function withIdentifier(bool $identifier): static
341
    {
UNCOV
342
        $self = clone $this;
×
UNCOV
343
        $self->identifier = $identifier;
×
344

UNCOV
345
        return $self;
×
346
    }
347

348
    public function getDefault(): mixed
349
    {
UNCOV
350
        return $this->default;
×
351
    }
352

353
    public function withDefault(mixed $default): static
354
    {
UNCOV
355
        $self = clone $this;
×
UNCOV
356
        $self->default = $default;
×
357

UNCOV
358
        return $self;
×
359
    }
360

361
    public function getExample(): mixed
362
    {
UNCOV
363
        return $this->example;
×
364
    }
365

366
    public function withExample(mixed $example): static
367
    {
UNCOV
368
        $self = clone $this;
×
UNCOV
369
        $self->example = $example;
×
370

UNCOV
371
        return $self;
×
372
    }
373

374
    public function getDeprecationReason(): ?string
375
    {
UNCOV
376
        return $this->deprecationReason;
×
377
    }
378

379
    /**
380
     * @param string $deprecationReason
381
     */
382
    public function withDeprecationReason($deprecationReason): static
383
    {
UNCOV
384
        $self = clone $this;
×
UNCOV
385
        $self->deprecationReason = $deprecationReason;
×
386

UNCOV
387
        return $self;
×
388
    }
389

390
    public function isFetchable(): ?bool
391
    {
UNCOV
392
        return $this->fetchable;
×
393
    }
394

395
    /**
396
     * @param bool $fetchable
397
     */
398
    public function withFetchable($fetchable): static
399
    {
400
        $self = clone $this;
×
401
        $self->fetchable = $fetchable;
×
402

403
        return $self;
×
404
    }
405

406
    public function getFetchEager(): ?bool
407
    {
UNCOV
408
        return $this->fetchEager;
×
409
    }
410

411
    /**
412
     * @param bool $fetchEager
413
     */
414
    public function withFetchEager($fetchEager): static
415
    {
416
        $self = clone $this;
×
417
        $self->fetchEager = $fetchEager;
×
418

419
        return $self;
×
420
    }
421

422
    public function getJsonldContext(): ?array
423
    {
UNCOV
424
        return $this->jsonldContext;
×
425
    }
426

427
    /**
428
     * @param array $jsonldContext
429
     */
430
    public function withJsonldContext($jsonldContext): static
431
    {
UNCOV
432
        $self = clone $this;
×
UNCOV
433
        $self->jsonldContext = $jsonldContext;
×
434

UNCOV
435
        return $self;
×
436
    }
437

438
    public function getOpenapiContext(): ?array
439
    {
UNCOV
440
        return $this->openapiContext;
×
441
    }
442

443
    /**
444
     * @param array $openapiContext
445
     */
446
    public function withOpenapiContext($openapiContext): static
447
    {
UNCOV
448
        $self = clone $this;
×
UNCOV
449
        $self->openapiContext = $openapiContext;
×
450

UNCOV
451
        return $self;
×
452
    }
453

454
    public function getJsonSchemaContext(): ?array
455
    {
UNCOV
456
        return $this->jsonSchemaContext;
×
457
    }
458

459
    /**
460
     * @param array $jsonSchemaContext
461
     */
462
    public function withJsonSchemaContext($jsonSchemaContext): static
463
    {
UNCOV
464
        $self = clone $this;
×
UNCOV
465
        $self->jsonSchemaContext = $jsonSchemaContext;
×
466

UNCOV
467
        return $self;
×
468
    }
469

470
    public function getPush(): ?bool
471
    {
UNCOV
472
        return $this->push;
×
473
    }
474

475
    /**
476
     * @param bool $push
477
     */
478
    public function withPush($push): static
479
    {
UNCOV
480
        $self = clone $this;
×
UNCOV
481
        $self->push = $push;
×
482

UNCOV
483
        return $self;
×
484
    }
485

486
    public function getSecurity(): ?string
487
    {
UNCOV
488
        return $this->security instanceof \Stringable ? (string) $this->security : $this->security;
×
489
    }
490

491
    public function withSecurity(string|\Stringable|null $security = null): static
492
    {
UNCOV
493
        $self = clone $this;
×
UNCOV
494
        $self->security = $security;
×
495

UNCOV
496
        return $self;
×
497
    }
498

499
    public function getSecurityPostDenormalize(): ?string
500
    {
UNCOV
501
        return $this->securityPostDenormalize instanceof \Stringable ? (string) $this->securityPostDenormalize : $this->securityPostDenormalize;
×
502
    }
503

504
    public function withSecurityPostDenormalize(string|\Stringable|null $securityPostDenormalize = null): static
505
    {
UNCOV
506
        $self = clone $this;
×
UNCOV
507
        $self->securityPostDenormalize = $securityPostDenormalize;
×
508

UNCOV
509
        return $self;
×
510
    }
511

512
    public function getTypes(): ?array
513
    {
UNCOV
514
        return $this->types;
×
515
    }
516

517
    /**
518
     * @param string[]|string $types
519
     */
520
    public function withTypes(array|string $types = []): static
521
    {
UNCOV
522
        $self = clone $this;
×
UNCOV
523
        $self->types = (array) $types;
×
524

UNCOV
525
        return $self;
×
526
    }
527

528
    /**
529
     * deprecated since 4.2, use "getNativeType" instead.
530
     *
531
     * @return LegacyType[]|null
532
     */
533
    public function getBuiltinTypes(): ?array
534
    {
535
        trigger_deprecation('api-platform/metadata', '4.2', 'The "%s()" method is deprecated, use "%s::getNativeType()" instead.', __METHOD__, self::class);
×
536

537
        if (null === $this->builtinTypes && null !== $this->nativeType) {
×
538
            $this->builtinTypes = PropertyInfoToTypeInfoHelper::convertTypeToLegacyTypes($this->nativeType) ?? [];
×
539
        }
540

541
        return $this->builtinTypes;
×
542
    }
543

544
    /**
545
     * deprecated since 4.2, use "withNativeType" instead.
546
     *
547
     * @param LegacyType[] $builtinTypes
548
     */
549
    public function withBuiltinTypes(array $builtinTypes = []): static
550
    {
551
        trigger_deprecation('api-platform/metadata', '4.2', 'The "%s()" method is deprecated, use "%s::withNativeType()" instead.', __METHOD__, self::class);
×
552

553
        $self = clone $this;
×
554
        $self->builtinTypes = $builtinTypes;
×
555
        $self->nativeType = PropertyInfoToTypeInfoHelper::convertLegacyTypesToType($builtinTypes);
×
556

557
        return $self;
×
558
    }
559

560
    public function getNativeType(): ?Type
561
    {
UNCOV
562
        return $this->nativeType;
×
563
    }
564

565
    public function withNativeType(?Type $nativeType): self
566
    {
UNCOV
567
        $self = clone $this;
×
UNCOV
568
        $self->nativeType = $nativeType;
×
569

UNCOV
570
        return $self;
×
571
    }
572

573
    public function getSchema(): ?array
574
    {
UNCOV
575
        return $this->schema;
×
576
    }
577

578
    public function withSchema(array $schema = []): static
579
    {
UNCOV
580
        $self = clone $this;
×
UNCOV
581
        $self->schema = $schema;
×
582

UNCOV
583
        return $self;
×
584
    }
585

586
    public function withInitializable(?bool $initializable): static
587
    {
UNCOV
588
        $self = clone $this;
×
UNCOV
589
        $self->initializable = $initializable;
×
590

UNCOV
591
        return $self;
×
592
    }
593

594
    public function isInitializable(): ?bool
595
    {
UNCOV
596
        return $this->initializable;
×
597
    }
598

599
    public function getExtraProperties(): array
600
    {
UNCOV
601
        return $this->extraProperties;
×
602
    }
603

604
    public function withExtraProperties(array $extraProperties = []): static
605
    {
UNCOV
606
        $self = clone $this;
×
UNCOV
607
        $self->extraProperties = $extraProperties;
×
608

UNCOV
609
        return $self;
×
610
    }
611

612
    /**
613
     * Gets IRI of this property.
614
     *
615
     * @return string[]|null
616
     */
617
    public function getIris()
618
    {
UNCOV
619
        return $this->iris;
×
620
    }
621

622
    /**
623
     * Returns a new instance with the given IRI.
624
     *
625
     * @param string|string[] $iris
626
     */
627
    public function withIris(string|array $iris): static
628
    {
UNCOV
629
        $metadata = clone $this;
×
UNCOV
630
        $metadata->iris = (array) $iris;
×
631

UNCOV
632
        return $metadata;
×
633
    }
634

635
    /**
636
     * Whether to generate a skolem iri on anonymous resources.
637
     */
638
    public function getGenId(): ?bool
639
    {
UNCOV
640
        return $this->genId;
×
641
    }
642

643
    public function withGenId(bool $genId): static
644
    {
UNCOV
645
        $metadata = clone $this;
×
UNCOV
646
        $metadata->genId = $genId;
×
647

UNCOV
648
        return $metadata;
×
649
    }
650

651
    /**
652
     * Whether to return the subRessource collection IRI instead of an iterable of IRI.
653
     */
654
    public function getUriTemplate(): ?string
655
    {
UNCOV
656
        return $this->uriTemplate;
×
657
    }
658

659
    public function withUriTemplate(?string $uriTemplate): static
660
    {
661
        $metadata = clone $this;
×
662
        $metadata->uriTemplate = $uriTemplate;
×
663

664
        return $metadata;
×
665
    }
666

667
    public function getPolicy(): ?string
668
    {
UNCOV
669
        return $this->policy;
×
670
    }
671

672
    public function withPolicy(?string $policy): static
673
    {
674
        $self = clone $this;
×
675
        $self->policy = $policy;
×
676

677
        return $self;
×
678
    }
679

680
    public function getSerialize(): ?array
681
    {
UNCOV
682
        return $this->serialize;
×
683
    }
684

685
    /**
686
     * @param Context|Groups|Ignore|SerializedName|SerializedPath|MaxDepth|array<array-key, Context|Groups|Ignore|SerializedName|SerializedPath|MaxDepth> $serialize
687
     */
688
    public function withSerialize(array|Context|Groups|Ignore|SerializedName|SerializedPath|MaxDepth $serialize): static
689
    {
690
        $self = clone $this;
×
691
        $self->serialize = (array) $serialize;
×
692

693
        return $self;
×
694
    }
695

696
    public function getHydra(): ?bool
697
    {
UNCOV
698
        return $this->hydra;
×
699
    }
700

701
    public function withHydra(bool $hydra): static
702
    {
UNCOV
703
        $self = clone $this;
×
UNCOV
704
        $self->hydra = $hydra;
×
705

UNCOV
706
        return $self;
×
707
    }
708
}
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