|
|
@@ -27,7 +27,7 @@ class TypeMap
|
|
|
* Used to avoid repetition when calling multiple functions inside this class that
|
|
|
* may require a custom type for a specific field.
|
|
|
*
|
|
|
- * @var array
|
|
|
+ * @var string[]
|
|
|
*/
|
|
|
protected $_defaults;
|
|
|
|
|
|
@@ -37,14 +37,14 @@ class TypeMap
|
|
|
* Used to avoid repetition when calling multiple functions inside this class that
|
|
|
* may require a custom type for a specific field.
|
|
|
*
|
|
|
- * @var array
|
|
|
+ * @var string[]
|
|
|
*/
|
|
|
protected $_types = [];
|
|
|
|
|
|
/**
|
|
|
* Creates an instance with the given defaults
|
|
|
*
|
|
|
- * @param array $defaults The defaults to use.
|
|
|
+ * @param string[] $defaults The defaults to use.
|
|
|
*/
|
|
|
public function __construct(array $defaults = [])
|
|
|
{
|
|
|
@@ -69,7 +69,7 @@ class TypeMap
|
|
|
* This method will replace all the existing default mappings with the ones provided.
|
|
|
* To add into the mappings use `addDefaults()`.
|
|
|
*
|
|
|
- * @param array $defaults Associative array where keys are field names and values
|
|
|
+ * @param string[] $defaults Associative array where keys are field names and values
|
|
|
* are the correspondent type.
|
|
|
* @return $this
|
|
|
*/
|
|
|
@@ -83,7 +83,7 @@ class TypeMap
|
|
|
/**
|
|
|
* Returns the currently configured types.
|
|
|
*
|
|
|
- * @return array
|
|
|
+ * @return string[]
|
|
|
*/
|
|
|
public function getDefaults(): array
|
|
|
{
|
|
|
@@ -95,7 +95,7 @@ class TypeMap
|
|
|
*
|
|
|
* If a key already exists it will not be overwritten.
|
|
|
*
|
|
|
- * @param array $types The additional types to add.
|
|
|
+ * @param string[] $types The additional types to add.
|
|
|
* @return void
|
|
|
*/
|
|
|
public function addDefaults(array $types): void
|
|
|
@@ -114,7 +114,7 @@ class TypeMap
|
|
|
*
|
|
|
* This method will replace all the existing type maps with the ones provided.
|
|
|
*
|
|
|
- * @param array $types Associative array where keys are field names and values
|
|
|
+ * @param string[] $types Associative array where keys are field names and values
|
|
|
* are the correspondent type.
|
|
|
* @return $this
|
|
|
*/
|
|
|
@@ -128,7 +128,7 @@ class TypeMap
|
|
|
/**
|
|
|
* Gets a map of fields and their associated types for single-use.
|
|
|
*
|
|
|
- * @return array
|
|
|
+ * @return string[]
|
|
|
*/
|
|
|
public function getTypes(): array
|
|
|
{
|
|
|
@@ -141,7 +141,7 @@ class TypeMap
|
|
|
* null will be returned.
|
|
|
*
|
|
|
* @param string|int $column The type for a given column
|
|
|
- * @return null|string
|
|
|
+ * @return string|null
|
|
|
*/
|
|
|
public function type($column): ?string
|
|
|
{
|
|
|
@@ -158,7 +158,7 @@ class TypeMap
|
|
|
/**
|
|
|
* Returns an array of all types mapped types
|
|
|
*
|
|
|
- * @return array
|
|
|
+ * @return string[]
|
|
|
*/
|
|
|
public function toArray(): array
|
|
|
{
|