Skip to content

Commit 037f9ee

Browse files
committed
📦 Add runtime deprecation when there is used deprecated way to configure attribute
1 parent 750ec00 commit 037f9ee

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Annotations/Assertion.php

+6
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ public function __construct(
5252
$this->constraint = is_array($constraint) ? $constraint : [$constraint];
5353

5454
if (null !== $for) {
55+
trigger_error(
56+
"Using #[Assertion(for='" . $for . "', constaint='...')] on methods is deprecated in favor " .
57+
"of #[Assertion(constraint='...')] the parameter itself.",
58+
E_USER_DEPRECATED,
59+
);
60+
5561
$this->for = ltrim($for, '$');
5662
}
5763
}

0 commit comments

Comments
 (0)