diff --git a/core/lib/Drupal/Core/TypedData/Plugin/DataType/BooleanData.php b/core/lib/Drupal/Core/TypedData/Plugin/DataType/BooleanData.php
index 1583c79bd7..5c5d8ff557 100644
--- a/core/lib/Drupal/Core/TypedData/Plugin/DataType/BooleanData.php
+++ b/core/lib/Drupal/Core/TypedData/Plugin/DataType/BooleanData.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types = 1);
+
 namespace Drupal\Core\TypedData\Plugin\DataType;
 
 use Drupal\Core\TypedData\PrimitiveBase;
@@ -21,7 +23,7 @@ class BooleanData extends PrimitiveBase implements BooleanInterface {
   /**
    * {@inheritdoc}
    */
-  public function getCastedValue() {
+  public function getValue(): bool {
     return (bool) $this->value;
   }
 
diff --git a/core/lib/Drupal/Core/TypedData/Plugin/DataType/FloatData.php b/core/lib/Drupal/Core/TypedData/Plugin/DataType/FloatData.php
index 4de7e18b22..69947fb5db 100644
--- a/core/lib/Drupal/Core/TypedData/Plugin/DataType/FloatData.php
+++ b/core/lib/Drupal/Core/TypedData/Plugin/DataType/FloatData.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types = 1);
+
 namespace Drupal\Core\TypedData\Plugin\DataType;
 
 use Drupal\Core\TypedData\PrimitiveBase;
@@ -21,7 +23,7 @@ class FloatData extends PrimitiveBase implements FloatInterface {
   /**
    * {@inheritdoc}
    */
-  public function getCastedValue() {
+  public function getValue(): float {
     return (float) $this->value;
   }
 
diff --git a/core/lib/Drupal/Core/TypedData/Plugin/DataType/IntegerData.php b/core/lib/Drupal/Core/TypedData/Plugin/DataType/IntegerData.php
index 8421dcaf2f..9200126848 100644
--- a/core/lib/Drupal/Core/TypedData/Plugin/DataType/IntegerData.php
+++ b/core/lib/Drupal/Core/TypedData/Plugin/DataType/IntegerData.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types = 1);
+
 namespace Drupal\Core\TypedData\Plugin\DataType;
 
 use Drupal\Core\TypedData\PrimitiveBase;
@@ -21,7 +23,7 @@ class IntegerData extends PrimitiveBase implements IntegerInterface {
   /**
    * {@inheritdoc}
    */
-  public function getCastedValue() {
+  public function getValue(): int {
     return (int) $this->value;
   }
 
diff --git a/core/lib/Drupal/Core/TypedData/Plugin/DataType/StringData.php b/core/lib/Drupal/Core/TypedData/Plugin/DataType/StringData.php
index 270f116257..d3dafbe9ac 100644
--- a/core/lib/Drupal/Core/TypedData/Plugin/DataType/StringData.php
+++ b/core/lib/Drupal/Core/TypedData/Plugin/DataType/StringData.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types = 1);
+
 namespace Drupal\Core\TypedData\Plugin\DataType;
 
 use Drupal\Core\TypedData\PrimitiveBase;
@@ -21,7 +23,7 @@ class StringData extends PrimitiveBase implements StringInterface {
   /**
    * {@inheritdoc}
    */
-  public function getCastedValue() {
+  public function getValue(): string {
     return $this->getString();
   }
 
diff --git a/core/lib/Drupal/Core/TypedData/PrimitiveBase.php b/core/lib/Drupal/Core/TypedData/PrimitiveBase.php
index ac2d1c130b..bcca12f7d0 100644
--- a/core/lib/Drupal/Core/TypedData/PrimitiveBase.php
+++ b/core/lib/Drupal/Core/TypedData/PrimitiveBase.php
@@ -32,4 +32,11 @@ public function setValue($value, $notify = TRUE) {
     }
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function getCastedValue() {
+    return $this->getValue();
+  }
+
 }
