Backup of db before drupal security update
[yaffs-website] / web / core / lib / Drupal / Core / TypedData / Plugin / DataType / FloatData.php
1 <?php
2
3 namespace Drupal\Core\TypedData\Plugin\DataType;
4
5 use Drupal\Core\TypedData\PrimitiveBase;
6 use Drupal\Core\TypedData\Type\FloatInterface;
7
8 /**
9  * The float data type.
10  *
11  * The plain value of a float is a regular PHP float. For setting the value
12  * any PHP variable that casts to a float may be passed.
13  *
14  * @DataType(
15  *   id = "float",
16  *   label = @Translation("Float")
17  * )
18  */
19 class FloatData extends PrimitiveBase implements FloatInterface {
20
21   /**
22    * {@inheritdoc}
23    */
24   public function getCastedValue() {
25     return (float) $this->value;
26   }
27
28 }