File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 34
34
use function get_class ;
35
35
use function is_a ;
36
36
use function reset ;
37
+ use function trigger_error ;
38
+
39
+ use const E_USER_DEPRECATED ;
37
40
38
41
class AnnotationReader
39
42
{
@@ -261,6 +264,14 @@ public function getParameterAnnotationsPerParameter(array $refParameters): array
261
264
262
265
$ parameterAnnotations = $ this ->getMethodAnnotations ($ method , ParameterAnnotationInterface::class);
263
266
foreach ($ parameterAnnotations as $ parameterAnnotation ) {
267
+ trigger_error (
268
+ "Using ' " . ParameterAnnotationInterface::class . "' over methods is deprecated. " .
269
+ "Found attribute ' " . $ parameterAnnotation ::class .
270
+ "' over ' " . $ method ->getDeclaringClass ()->getName () . ': ' . $ method ->getName () . "'. " .
271
+ "Please target annotation to the parameter '$ " . $ parameterAnnotation ->getTarget () . "' instead " ,
272
+ E_USER_DEPRECATED ,
273
+ );
274
+
264
275
$ parameterAnnotationsPerParameter [$ parameterAnnotation ->getTarget ()][] = $ parameterAnnotation ;
265
276
}
266
277
You can’t perform that action at this time.
0 commit comments