diff --git a/core/lib/Drupal/Core/TypedData/Validation/ConstraintViolationBuilder.php b/core/lib/Drupal/Core/TypedData/Validation/ConstraintViolationBuilder.php
index 9d5cdff7fe678be72d3b01cd19821b91a20a0349..3d68a4a9cdbce3530136f872c8d8bc906d830b6d 100644
--- a/core/lib/Drupal/Core/TypedData/Validation/ConstraintViolationBuilder.php
+++ b/core/lib/Drupal/Core/TypedData/Validation/ConstraintViolationBuilder.php
@@ -146,7 +146,7 @@ public function __construct(ConstraintViolationList $violations, Constraint $con
      *
      * @see https://www.drupal.org/node/3238432
      */
-    public function atPath($path)
+    public function atPath($path): static
     {
       @trigger_error(__METHOD__ . ' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Violation\ConstraintViolationBuilder::atPath() instead. See https://www.drupal.org/node/3238432', E_USER_DEPRECATED);
       $this->propertyPath = PropertyPath::append($this->propertyPath, $path);
@@ -163,7 +163,7 @@ public function atPath($path)
      *
      * @see https://www.drupal.org/node/3238432
      */
-    public function setParameter($key, $value)
+    public function setParameter($key, $value): static
     {
       @trigger_error(__METHOD__ . ' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Violation\ConstraintViolationBuilder::setParameter() instead. See https://www.drupal.org/node/3238432', E_USER_DEPRECATED);
       $this->parameters[$key] = $value;
@@ -180,7 +180,7 @@ public function setParameter($key, $value)
      *
      * @see https://www.drupal.org/node/3238432
      */
-    public function setParameters(array $parameters)
+    public function setParameters(array $parameters): static
     {
       @trigger_error(__METHOD__ . ' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Violation\ConstraintViolationBuilder::setParameters() instead. See https://www.drupal.org/node/3238432', E_USER_DEPRECATED);
       $this->parameters = $parameters;
@@ -197,7 +197,7 @@ public function setParameters(array $parameters)
      *
      * @see https://www.drupal.org/node/3238432
      */
-    public function setTranslationDomain($translationDomain)
+    public function setTranslationDomain($translationDomain): static
     {
       @trigger_error(__METHOD__ . ' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Violation\ConstraintViolationBuilder::setTranslationDomain() instead. See https://www.drupal.org/node/3238432', E_USER_DEPRECATED);
       $this->translationDomain = $translationDomain;
@@ -214,7 +214,7 @@ public function setTranslationDomain($translationDomain)
      *
      * @see https://www.drupal.org/node/3238432
      */
-    public function setInvalidValue($invalidValue)
+    public function setInvalidValue($invalidValue): static
     {
       @trigger_error(__METHOD__ . ' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Violation\ConstraintViolationBuilder::setInvalidValue() instead. See https://www.drupal.org/node/3238432', E_USER_DEPRECATED);
       $this->invalidValue = $invalidValue;
@@ -231,7 +231,7 @@ public function setInvalidValue($invalidValue)
      *
      * @see https://www.drupal.org/node/3238432
      */
-    public function setPlural($number)
+    public function setPlural($number): static
     {
       @trigger_error(__METHOD__ . ' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Violation\ConstraintViolationBuilder::setPlural() instead. See https://www.drupal.org/node/3238432', E_USER_DEPRECATED);
       $this->plural = $number;
@@ -248,7 +248,7 @@ public function setPlural($number)
      *
      * @see https://www.drupal.org/node/3238432
      */
-    public function setCode($code)
+    public function setCode($code): static
     {
       @trigger_error(__METHOD__ . ' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Violation\ConstraintViolationBuilder::setCode() instead. See https://www.drupal.org/node/3238432', E_USER_DEPRECATED);
       $this->code = $code;
@@ -265,7 +265,7 @@ public function setCode($code)
      *
      * @see https://www.drupal.org/node/3238432
      */
-    public function setCause($cause)
+    public function setCause($cause): static
     {
       @trigger_error(__METHOD__ . ' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Symfony\Component\Validator\Violation\ConstraintViolationBuilder::setCause() instead. See https://www.drupal.org/node/3238432', E_USER_DEPRECATED);
       $this->cause = $cause;