Skip to content

Commit fdf22f5

Browse files
committed
chore: remove unuseful private properties from ApiResource
It has been fixed by Haehnchen/idea-php-annotation-plugin@7a75efc.
1 parent a5bd35a commit fdf22f5

File tree

4 files changed

+1
-344
lines changed

4 files changed

+1
-344
lines changed

src/Annotation/ApiProperty.php

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -76,55 +76,6 @@ final class ApiProperty
7676
*/
7777
public $identifier;
7878

79-
/**
80-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
81-
*
82-
* @var string
83-
*/
84-
private $deprecationReason;
85-
86-
/**
87-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
88-
*
89-
* @var bool
90-
*/
91-
private $fetchable;
92-
93-
/**
94-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
95-
*
96-
* @var bool
97-
*/
98-
private $fetchEager;
99-
100-
/**
101-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
102-
*
103-
* @var array
104-
*/
105-
private $jsonldContext;
106-
107-
/**
108-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
109-
*
110-
* @var array
111-
*/
112-
private $openapiContext;
113-
114-
/**
115-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
116-
*
117-
* @var bool
118-
*/
119-
private $push;
120-
121-
/**
122-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
123-
*
124-
* @var array
125-
*/
126-
private $swaggerContext;
127-
12879
/**
12980
* @throws InvalidArgumentException
13081
*/

src/Annotation/ApiResource.php

Lines changed: 0 additions & 277 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,16 @@
2525
* @Attributes(
2626
* @Attribute("accessControl", type="string"),
2727
* @Attribute("accessControlMessage", type="string"),
28-
* @Attribute("attributes", type="array"),
2928
* @Attribute("cacheHeaders", type="array"),
30-
* @Attribute("collectionOperations", type="array"),
3129
* @Attribute("denormalizationContext", type="array"),
3230
* @Attribute("deprecationReason", type="string"),
33-
* @Attribute("description", type="string"),
3431
* @Attribute("elasticsearch", type="bool"),
3532
* @Attribute("fetchPartial", type="bool"),
3633
* @Attribute("forceEager", type="bool"),
3734
* @Attribute("formats", type="array"),
3835
* @Attribute("filters", type="string[]"),
39-
* @Attribute("graphql", type="array"),
4036
* @Attribute("hydraContext", type="array"),
4137
* @Attribute("input", type="mixed"),
42-
* @Attribute("iri", type="string"),
43-
* @Attribute("itemOperations", type="array"),
4438
* @Attribute("mercure", type="mixed"),
4539
* @Attribute("messenger", type="mixed"),
4640
* @Attribute("normalizationContext", type="array"),
@@ -62,8 +56,6 @@
6256
* @Attribute("securityMessage", type="string"),
6357
* @Attribute("securityPostDenormalize", type="string"),
6458
* @Attribute("securityPostDenormalizeMessage", type="string"),
65-
* @Attribute("shortName", type="string"),
66-
* @Attribute("subresourceOperations", type="array"),
6759
* @Attribute("sunset", type="string"),
6860
* @Attribute("swaggerContext", type="array"),
6961
* @Attribute("validationGroups", type="mixed")
@@ -116,275 +108,6 @@ final class ApiResource
116108
*/
117109
public $subresourceOperations;
118110

119-
/**
120-
* @see https://api-platform.com/docs/core/performance/#setting-custom-http-cache-headers
121-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
122-
*
123-
* @var array
124-
*/
125-
private $cacheHeaders;
126-
127-
/**
128-
* @see https://api-platform.com/docs/core/serialization/#using-serialization-groups
129-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
130-
*
131-
* @var array
132-
*/
133-
private $denormalizationContext;
134-
135-
/**
136-
* @see https://api-platform.com/docs/core/deprecations/#deprecating-resource-classes-operations-and-properties
137-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
138-
*
139-
* @var string
140-
*/
141-
private $deprecationReason;
142-
143-
/**
144-
* @see https://api-platform.com/docs/core/elasticsearch/
145-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
146-
*
147-
* @var bool
148-
*/
149-
private $elasticsearch;
150-
151-
/**
152-
* @see https://api-platform.com/docs/core/performance/#fetch-partial
153-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
154-
*
155-
* @var bool
156-
*/
157-
private $fetchPartial;
158-
159-
/**
160-
* @see https://api-platform.com/docs/core/performance/#force-eager
161-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
162-
*
163-
* @var bool
164-
*/
165-
private $forceEager;
166-
167-
/**
168-
* @see https://api-platform.com/docs/core/content-negotiation/#configuring-formats-for-a-specific-resource-or-operation
169-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
170-
*
171-
* @var array
172-
*/
173-
private $formats;
174-
175-
/**
176-
* @see https://api-platform.com/docs/core/filters/#doctrine-orm-and-mongodb-odm-filters
177-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
178-
*
179-
* @var string[]
180-
*/
181-
private $filters;
182-
183-
/**
184-
* @see https://api-platform.com/docs/core/extending-jsonld-context/#hydra
185-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
186-
*
187-
* @var string[]
188-
*/
189-
private $hydraContext;
190-
191-
/**
192-
* @see https://api-platform.com/docs/core/dto/#specifying-an-input-or-an-output-data-representation
193-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
194-
*
195-
* @var string|false
196-
*/
197-
private $input;
198-
199-
/**
200-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
201-
*
202-
* @var int
203-
*
204-
* @deprecated - Use $paginationMaximumItemsPerPage instead
205-
*/
206-
private $maximumItemsPerPage;
207-
208-
/**
209-
* @see https://api-platform.com/docs/core/mercure
210-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
211-
*/
212-
private $mercure;
213-
214-
/**
215-
* @see https://api-platform.com/docs/core/messenger/#dispatching-a-resource-through-the-message-bus
216-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
217-
*
218-
* @var bool|string
219-
*/
220-
private $messenger;
221-
222-
/**
223-
* @see https://api-platform.com/docs/core/serialization/#using-serialization-groups
224-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
225-
*
226-
* @var array
227-
*/
228-
private $normalizationContext;
229-
230-
/**
231-
* @see https://api-platform.com/docs/core/swagger/#using-the-openapi-and-swagger-contexts
232-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
233-
*
234-
* @var array
235-
*/
236-
private $openapiContext;
237-
238-
/**
239-
* @see https://api-platform.com/docs/core/default-order/#overriding-default-order
240-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
241-
*
242-
* @var array
243-
*/
244-
private $order;
245-
246-
/**
247-
* @see https://api-platform.com/docs/core/dto/#specifying-an-input-or-an-output-data-representation
248-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
249-
*
250-
* @var string|false
251-
*/
252-
private $output;
253-
254-
/**
255-
* @see https://api-platform.com/docs/core/pagination/#for-a-specific-resource-1
256-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
257-
*
258-
* @var bool
259-
*/
260-
private $paginationClientEnabled;
261-
262-
/**
263-
* @see https://api-platform.com/docs/core/pagination/#for-a-specific-resource-3
264-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
265-
*
266-
* @var bool
267-
*/
268-
private $paginationClientItemsPerPage;
269-
270-
/**
271-
* @see https://api-platform.com/docs/core/pagination/#for-a-specific-resource-6
272-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
273-
*
274-
* @var bool
275-
*/
276-
private $paginationClientPartial;
277-
278-
/**
279-
* @see https://api-platform.com/docs/core/pagination/#cursor-based-pagination
280-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
281-
*
282-
* @var array
283-
*/
284-
private $paginationViaCursor;
285-
286-
/**
287-
* @see https://api-platform.com/docs/core/pagination/#for-a-specific-resource
288-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
289-
*
290-
* @var bool
291-
*/
292-
private $paginationEnabled;
293-
294-
/**
295-
* @see https://api-platform.com/docs/core/pagination/#controlling-the-behavior-of-the-doctrine-orm-paginator
296-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
297-
*
298-
* @var bool
299-
*/
300-
private $paginationFetchJoinCollection;
301-
302-
/**
303-
* @see https://api-platform.com/docs/core/pagination/#changing-the-number-of-items-per-page
304-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
305-
*
306-
* @var int
307-
*/
308-
private $paginationItemsPerPage;
309-
310-
/**
311-
* @see https://api-platform.com/docs/core/pagination/#changing-maximum-items-per-page
312-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
313-
*
314-
* @var int
315-
*/
316-
private $paginationMaximumItemsPerPage;
317-
318-
/**
319-
* @see https://api-platform.com/docs/core/performance/#partial-pagination
320-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
321-
*
322-
* @var bool
323-
*/
324-
private $paginationPartial;
325-
326-
/**
327-
* @see https://api-platform.com/docs/core/operations/#prefixing-all-routes-of-all-operations
328-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
329-
*
330-
* @var string
331-
*/
332-
private $routePrefix;
333-
334-
/**
335-
* @see https://api-platform.com/docs/core/security
336-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
337-
*
338-
* @var string
339-
*/
340-
private $security;
341-
342-
/**
343-
* @see https://api-platform.com/docs/core/security/#configuring-the-access-control-error-message
344-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
345-
*
346-
* @var string
347-
*/
348-
private $securityMessage;
349-
350-
/**
351-
* @see https://api-platform.com/docs/core/security/#executing-access-control-rules-after-denormalization
352-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
353-
*
354-
* @var string
355-
*/
356-
private $securityPostDenormalize;
357-
358-
/**
359-
* @see https://api-platform.com/docs/core/security/#configuring-the-access-control-error-message
360-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
361-
*
362-
* @var string
363-
*/
364-
private $securityPostDenormalizeMessage;
365-
366-
/**
367-
* @see https://api-platform.com/docs/core/deprecations/#setting-the-sunset-http-header-to-indicate-when-a-resource-or-an-operation-will-be-removed
368-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
369-
*
370-
* @var string
371-
*/
372-
private $sunset;
373-
374-
/**
375-
* @see https://api-platform.com/docs/core/swagger/#using-the-openapi-and-swagger-contexts
376-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
377-
*
378-
* @var array
379-
*/
380-
private $swaggerContext;
381-
382-
/**
383-
* @see https://api-platform.com/docs/core/validation/#using-validation-groups
384-
* @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
385-
*/
386-
private $validationGroups;
387-
388111
/**
389112
* @throws InvalidArgumentException
390113
*/

src/Annotation/AttributesHydratorTrait.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,7 @@ private function hydrateAttributes(array $values): void
5454

5555
foreach ($values as $key => $value) {
5656
$key = (string) $key;
57-
if (!property_exists($this, $key)) {
58-
throw new InvalidArgumentException(sprintf('Unknown property "%s" on annotation "%s".', $key, self::class));
59-
}
60-
61-
if ((new \ReflectionProperty($this, $key))->isPublic()) {
57+
if (property_exists($this, $key) && (new \ReflectionProperty($this, $key))->isPublic()) {
6258
$this->{$key} = $value;
6359
continue;
6460
}

0 commit comments

Comments
 (0)