@@ -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
@@ -150,6 +150,7 @@ public function getSignalMethod(string $signal): ?\ReflectionMethod
150150
151151 /**
152152 * Returns an annotation value.
153+ * @deprecated
153154 */
154155 public static function parseAnnotation (\Reflector $ ref , string $ name ): ?array
155156 {
@@ -167,12 +168,20 @@ public static function parseAnnotation(\Reflector $ref, string $name): ?array
167168 }
168169 }
169170
171+ $ alt = match ($ name ) {
172+ 'persistent ' => '#[Nette\Application\Attributes\Persistent] ' ,
173+ 'deprecated ' => '#[Nette\Application\Attributes\Deprecated] ' ,
174+ 'crossOrigin ' => '#[Nette\Application\Attributes\Request(sameOrigin: false)] ' ,
175+ default => 'alternative '
176+ };
177+ trigger_error ("Annotation @ $ name is deprecated, use $ alt (used in " . Nette \Utils \Reflection::toString ($ ref ) . ') ' , E_USER_DEPRECATED );
170178 return $ res ;
171179 }
172180
173181
174182 /**
175183 * Has class specified annotation?
184+ * @deprecated
176185 */
177186 public function hasAnnotation (string $ name ): bool
178187 {
@@ -182,6 +191,7 @@ public function hasAnnotation(string $name): bool
182191
183192 /**
184193 * Returns an annotation value.
194+ * @deprecated
185195 */
186196 public function getAnnotation (string $ name ): mixed
187197 {
0 commit comments