@@ -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
@@ -189,6 +189,7 @@ public function getSignalMethod(string $signal): ?\ReflectionMethod
189189
190190 /**
191191 * Returns an annotation value.
192+ * @deprecated
192193 */
193194 public static function parseAnnotation (\Reflector $ ref , string $ name ): ?array
194195 {
@@ -206,12 +207,20 @@ public static function parseAnnotation(\Reflector $ref, string $name): ?array
206207 }
207208 }
208209
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 );
209217 return $ res ;
210218 }
211219
212220
213221 /**
214222 * Has class specified annotation?
223+ * @deprecated
215224 */
216225 public function hasAnnotation (string $ name ): bool
217226 {
@@ -221,6 +230,7 @@ public function hasAnnotation(string $name): bool
221230
222231 /**
223232 * Returns an annotation value.
233+ * @deprecated
224234 */
225235 public function getAnnotation (string $ name ): mixed
226236 {
0 commit comments