Skip to content

Commit f954c45

Browse files
committed
minor #14445 Update custom_constraint.rst static::class instead of get_class($this) (AndrewCherabaev)
This PR was submitted for the 5.1 branch but it was merged into the 4.4 branch instead. Discussion ---------- Update custom_constraint.rst static::class instead of get_class($this) Usage of self::class instead of get_class($this) <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `5.x` for features of unreleased versions). --> Commits ------- 1dee4f8 Update custom_constraint.rst
2 parents bf01eff + 1dee4f8 commit f954c45

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

validation/custom_constraint.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ has this default logic::
4545
// in the base Symfony\Component\Validator\Constraint class
4646
public function validatedBy()
4747
{
48-
return \get_class($this).'Validator';
48+
return static::class.'Validator';
4949
}
5050

5151
In other words, if you create a custom ``Constraint`` (e.g. ``MyConstraint``),

0 commit comments

Comments
 (0)