Browse Source

Merge pull request #13513 from cakephp/master-decimal

Document param types.
Mark Story 6 years ago
parent
commit
6bc951d34c

+ 1 - 1
src/Database/Type/BatchCastingInterface.php

@@ -28,7 +28,7 @@ interface BatchCastingInterface
      * this type.
      *
      * @param array $values The original array of values containing the fields to be casted
-     * @param array $fields The field keys to cast
+     * @param string[] $fields The field keys to cast
      * @param \Cake\Database\Driver $driver Object from which database preferences and configuration will be extracted.
      * @return array
      */

+ 5 - 5
src/Database/Type/DecimalType.php

@@ -70,7 +70,7 @@ class DecimalType extends Type implements TypeInterface, BatchCastingInterface
     /**
      * Convert integer data into the database format.
      *
-     * @param string|int|float $value The value to convert.
+     * @param mixed $value The value to convert.
      * @param \Cake\Database\Driver $driver The driver instance to convert with.
      * @return string|null
      * @throws \InvalidArgumentException
@@ -96,10 +96,9 @@ class DecimalType extends Type implements TypeInterface, BatchCastingInterface
     /**
      * Convert float values to PHP floats
      *
-     * @param null|string|resource $value The value to convert.
+     * @param mixed $value The value to convert.
      * @param \Cake\Database\Driver $driver The driver instance to convert with.
      * @return float|null
-     * @throws \Cake\Core\Exception\Exception
      */
     public function toPHP($value, Driver $driver)
     {
@@ -113,7 +112,7 @@ class DecimalType extends Type implements TypeInterface, BatchCastingInterface
     /**
      * {@inheritDoc}
      *
-     * @return array
+     * @return float[]
      */
     public function manyToPHP(array $values, array $fields, Driver $driver)
     {
@@ -144,7 +143,7 @@ class DecimalType extends Type implements TypeInterface, BatchCastingInterface
      * Marshals request data into PHP floats.
      *
      * @param mixed $value The value to convert.
-     * @return mixed Converted value.
+     * @return float|string|null Converted value.
      */
     public function marshal($value)
     {
@@ -170,6 +169,7 @@ class DecimalType extends Type implements TypeInterface, BatchCastingInterface
      *
      * @param bool $enable Whether or not to enable
      * @return $this
+     * @throws \RuntimeException
      */
     public function useLocaleParser($enable = true)
     {

+ 1 - 1
src/Database/Type/FloatType.php

@@ -102,7 +102,7 @@ class FloatType extends Type implements TypeInterface, BatchCastingInterface
     /**
      * {@inheritDoc}
      *
-     * @return array
+     * @return float[]
      */
     public function manyToPHP(array $values, array $fields, Driver $driver)
     {

+ 1 - 1
src/Database/Type/IntegerType.php

@@ -105,7 +105,7 @@ class IntegerType extends Type implements TypeInterface, BatchCastingInterface
     /**
      * {@inheritDoc}
      *
-     * @return array
+     * @return int[]
      */
     public function manyToPHP(array $values, array $fields, Driver $driver)
     {