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

api-platform / core / 17723449516

15 Sep 2025 05:52AM UTC coverage: 0.0% (-22.6%) from 22.578%
17723449516

Pull #7383

github

web-flow
Merge fa5b61e35 into 949c3c975
Pull Request #7383: fix(metadata): compute isWritable during updates

0 of 6 new or added lines in 4 files covered. (0.0%)

11356 existing lines in 371 files now uncovered.

0 of 48868 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/Link.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\OpenApi;
17
use Symfony\Component\TypeInfo\Type;
18

19
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER)]
20
final class Link extends Parameter
21
{
22
    public function __construct(
23
        private ?string $parameterName = null,
24
        private ?string $fromProperty = null,
25
        private ?string $toProperty = null,
26
        private ?string $fromClass = null,
27
        private ?string $toClass = null,
28
        private ?array $identifiers = null,
29
        private ?bool $compositeIdentifier = null,
30
        private ?string $expandedValue = null,
31

32
        string|\Stringable|null $security = null,
33
        ?string $securityMessage = null,
34
        private ?string $securityObjectName = null,
35

36
        ?string $key = null,
37
        ?array $schema = null,
38
        ?OpenApi\Model\Parameter $openApi = null,
39
        mixed $provider = null,
40
        mixed $filter = null,
41
        ?string $property = null,
42
        ?array $properties = null,
43
        ?string $description = null,
44
        ?bool $required = null,
45
        array $extraProperties = [],
46

47
        mixed $constraints = null,
48
        array|string|null $filterContext = null,
49
        ?Type $nativeType = null,
50
        ?bool $castToArray = null,
51
    ) {
52
        // For the inverse property shortcut
UNCOV
53
        if ($this->parameterName && class_exists($this->parameterName)) {
×
54
            $this->fromClass = $this->parameterName;
×
55
        }
56

UNCOV
57
        parent::__construct(
×
UNCOV
58
            key: $key,
×
UNCOV
59
            schema: $schema,
×
UNCOV
60
            openApi: $openApi,
×
UNCOV
61
            provider: $provider,
×
UNCOV
62
            filter: $filter,
×
UNCOV
63
            property: $property,
×
UNCOV
64
            properties: $properties,
×
UNCOV
65
            description: $description,
×
UNCOV
66
            required: $required,
×
UNCOV
67
            constraints: $constraints,
×
UNCOV
68
            security: $security,
×
UNCOV
69
            securityMessage: $securityMessage,
×
UNCOV
70
            extraProperties: $extraProperties,
×
UNCOV
71
            filterContext: $filterContext,
×
UNCOV
72
            nativeType: $nativeType,
×
UNCOV
73
            castToArray: $castToArray,
×
UNCOV
74
        );
×
75
    }
76

77
    public function getParameterName(): ?string
78
    {
UNCOV
79
        return $this->parameterName;
×
80
    }
81

82
    public function withParameterName(string $parameterName): self
83
    {
UNCOV
84
        $self = clone $this;
×
UNCOV
85
        $self->parameterName = $parameterName;
×
86

UNCOV
87
        return $self;
×
88
    }
89

90
    public function getFromClass(): ?string
91
    {
UNCOV
92
        return $this->fromClass;
×
93
    }
94

95
    public function withFromClass(string $fromClass): self
96
    {
UNCOV
97
        $self = clone $this;
×
UNCOV
98
        $self->fromClass = $fromClass;
×
99

UNCOV
100
        return $self;
×
101
    }
102

103
    public function getToClass(): ?string
104
    {
UNCOV
105
        return $this->toClass;
×
106
    }
107

108
    public function withToClass(string $toClass): self
109
    {
UNCOV
110
        $self = clone $this;
×
UNCOV
111
        $self->toClass = $toClass;
×
112

UNCOV
113
        return $self;
×
114
    }
115

116
    public function getFromProperty(): ?string
117
    {
UNCOV
118
        return $this->fromProperty;
×
119
    }
120

121
    public function withFromProperty(string $fromProperty): self
122
    {
UNCOV
123
        $self = $this;
×
UNCOV
124
        $self->fromProperty = $fromProperty;
×
125

UNCOV
126
        return $self;
×
127
    }
128

129
    public function getToProperty(): ?string
130
    {
UNCOV
131
        return $this->toProperty;
×
132
    }
133

134
    public function withToProperty(string $toProperty): self
135
    {
136
        $self = clone $this;
×
137
        $self->toProperty = $toProperty;
×
138

139
        return $self;
×
140
    }
141

142
    public function getIdentifiers(): ?array
143
    {
UNCOV
144
        return $this->identifiers;
×
145
    }
146

147
    public function withIdentifiers(array $identifiers): self
148
    {
UNCOV
149
        $self = clone $this;
×
UNCOV
150
        $self->identifiers = $identifiers;
×
151

UNCOV
152
        return $self;
×
153
    }
154

155
    public function getCompositeIdentifier(): ?bool
156
    {
UNCOV
157
        return $this->compositeIdentifier;
×
158
    }
159

160
    public function withCompositeIdentifier(bool $compositeIdentifier): self
161
    {
162
        $self = clone $this;
×
163
        $self->compositeIdentifier = $compositeIdentifier;
×
164

165
        return $self;
×
166
    }
167

168
    public function getExpandedValue(): ?string
169
    {
UNCOV
170
        return $this->expandedValue;
×
171
    }
172

173
    public function withExpandedValue(string $expandedValue): self
174
    {
175
        $self = clone $this;
×
176
        $self->expandedValue = $expandedValue;
×
177

178
        return $self;
×
179
    }
180

181
    public function getSecurity(): ?string
182
    {
UNCOV
183
        return $this->security;
×
184
    }
185

186
    public function getSecurityObjectName(): ?string
187
    {
UNCOV
188
        return $this->securityObjectName;
×
189
    }
190

191
    public function withSecurityObjectName(?string $securityObjectName): self
192
    {
193
        $self = clone $this;
×
194
        $self->securityObjectName = $securityObjectName;
×
195

196
        return $self;
×
197
    }
198

199
    public function withLink(self $link): self
200
    {
UNCOV
201
        $self = clone $this;
×
202

UNCOV
203
        if (!$self->getToProperty() && ($toProperty = $link->getToProperty())) {
×
UNCOV
204
            $self->toProperty = $toProperty;
×
205
        }
206

UNCOV
207
        if (!$self->getCompositeIdentifier() && ($compositeIdentifier = $link->getCompositeIdentifier())) {
×
208
            $self->compositeIdentifier = $compositeIdentifier;
×
209
        }
210

UNCOV
211
        if (!$self->getFromClass() && ($fromClass = $link->getFromClass())) {
×
212
            $self->fromClass = $fromClass;
×
213
        }
214

UNCOV
215
        if (!$self->getToClass() && ($toClass = $link->getToClass())) {
×
216
            $self->toClass = $toClass;
×
217
        }
218

UNCOV
219
        if (!$self->getIdentifiers() && ($identifiers = $link->getIdentifiers())) {
×
220
            $self->identifiers = $identifiers;
×
221
        }
222

UNCOV
223
        if (!$self->getFromProperty() && ($fromProperty = $link->getFromProperty())) {
×
224
            $self->fromProperty = $fromProperty;
×
225
        }
226

UNCOV
227
        if (!$self->getParameterName() && ($parameterName = $link->getParameterName())) {
×
228
            $self->parameterName = $parameterName;
×
229
        }
230

UNCOV
231
        if (!$self->getExpandedValue() && ($expandedValue = $link->getExpandedValue())) {
×
232
            $self->expandedValue = $expandedValue;
×
233
        }
234

UNCOV
235
        if (!$self->getSecurity() && ($security = $link->getSecurity())) {
×
236
            $self->security = $security;
×
237
        }
238

UNCOV
239
        if (!$self->getSecurityMessage() && ($securityMessage = $link->getSecurityMessage())) {
×
240
            $self->securityMessage = $securityMessage;
×
241
        }
242

UNCOV
243
        if (!$self->getSecurityObjectName() && ($securityObjectName = $link->getSecurityObjectName())) {
×
244
            $self->securityObjectName = $securityObjectName;
×
245
        }
246

UNCOV
247
        return $self;
×
248
    }
249
}
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