@@ -28,7 +28,7 @@ final class ComponentReflection extends \ReflectionClass
2828
2929
3030 /**
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].
3232 * @return array<string, array{def: mixed, type: string, since: ?string}>
3333 */
3434 public function getParameters (): array
@@ -75,7 +75,7 @@ public function getParameters(): array
7575
7676
7777 /**
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].
7979 * @return array<string, array{def: mixed, type: string, since: string}>
8080 */
8181 public function getPersistentParams (): array
@@ -254,6 +254,7 @@ private static function castScalar(mixed &$val, string $type): bool
254254
255255 /**
256256 * Returns an annotation value.
257+ * @deprecated
257258 */
258259 public static function parseAnnotation (\Reflector $ ref , string $ name ): ?array
259260 {
@@ -271,6 +272,13 @@ public static function parseAnnotation(\Reflector $ref, string $name): ?array
271272 }
272273 }
273274
275+ $ alt = match ($ name ) {
276+ 'persistent ' => '#[Nette\Application\Attributes\Persistent] ' ,
277+ 'deprecated ' => '#[Nette\Application\Attributes\Deprecated] ' ,
278+ 'crossOrigin ' => '#[Nette\Application\Attributes\Request(sameOrigin: false)] ' ,
279+ default => 'alternative '
280+ };
281+ trigger_error ("Annotation @ $ name is deprecated, use $ alt (used in " . Nette \Utils \Reflection::toString ($ ref ) . ') ' , E_USER_DEPRECATED );
274282 return $ res ;
275283 }
276284
@@ -289,6 +297,7 @@ public static function getType(\ReflectionParameter|\ReflectionProperty $item):
289297
290298 /**
291299 * Has class specified annotation?
300+ * @deprecated
292301 */
293302 public function hasAnnotation (string $ name ): bool
294303 {
@@ -298,6 +307,7 @@ public function hasAnnotation(string $name): bool
298307
299308 /**
300309 * Returns an annotation value.
310+ * @deprecated
301311 */
302312 public function getAnnotation (string $ name ): mixed
303313 {
0 commit comments