@@ -28,7 +28,7 @@ final class ComponentReflection extends \ReflectionClass
28
28
29
29
30
30
/**
31
- * Returns array of class properties that are public and have attribute #[Persistent] or #[Parameter] or annotation @persistent .
31
+ * Returns array of class properties that are public and have attribute #[Persistent] or #[Parameter].
32
32
* @return array<string, array{def: mixed, type: string, since: ?string}>
33
33
*/
34
34
public function getParameters (): array
@@ -75,7 +75,7 @@ public function getParameters(): array
75
75
76
76
77
77
/**
78
- * Returns array of persistent properties. They are public and have attribute #[Persistent] or annotation @persistent .
78
+ * Returns array of persistent properties. They are public and have attribute #[Persistent].
79
79
* @return array<string, array{def: mixed, type: string, since: string}>
80
80
*/
81
81
public function getPersistentParams (): array
@@ -189,6 +189,7 @@ public function getSignalMethod(string $signal): ?\ReflectionMethod
189
189
190
190
/**
191
191
* Returns an annotation value.
192
+ * @deprecated
192
193
*/
193
194
public static function parseAnnotation (\Reflector $ ref , string $ name ): ?array
194
195
{
@@ -206,12 +207,20 @@ public static function parseAnnotation(\Reflector $ref, string $name): ?array
206
207
}
207
208
}
208
209
210
+ $ alt = match ($ name ) {
211
+ 'persistent ' => '#[Nette\Application\Attributes\Persistent] ' ,
212
+ 'deprecated ' => '#[Nette\Application\Attributes\Deprecated] ' ,
213
+ 'crossOrigin ' => '#[Nette\Application\Attributes\Request(sameOrigin: false)] ' ,
214
+ default => 'alternative '
215
+ };
216
+ trigger_error ("Annotation @ $ name is deprecated, use $ alt (used in " . Nette \Utils \Reflection::toString ($ ref ) . ') ' , E_USER_DEPRECATED );
209
217
return $ res ;
210
218
}
211
219
212
220
213
221
/**
214
222
* Has class specified annotation?
223
+ * @deprecated
215
224
*/
216
225
public function hasAnnotation (string $ name ): bool
217
226
{
@@ -221,6 +230,7 @@ public function hasAnnotation(string $name): bool
221
230
222
231
/**
223
232
* Returns an annotation value.
233
+ * @deprecated
224
234
*/
225
235
public function getAnnotation (string $ name ): mixed
226
236
{
0 commit comments