Skip to content
Permalink
Browse files

Deprecate object usage for _types.

  • Loading branch information...
dereuromark committed Dec 2, 2017
1 parent a1db586 commit b94474dc17e29ea24ce223b91a0a7acdb62f76c4
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/Database/Type.php
@@ -106,9 +106,7 @@ public static function build($name)
throw new InvalidArgumentException(sprintf('Unknown type "%s"', $name));
}
if (is_string(static::$_types[$name])) {
static::$_types[$name] = new static::$_types[$name]($name);
return static::$_builtTypes[$name] = static::$_types[$name];
return static::$_builtTypes[$name] = new static::$_types[$name]($name);
}
return static::$_builtTypes[$name] = static::$_types[$name];
@@ -146,6 +144,9 @@ public static function set($name, Type $instance)
* If called with no arguments it will return current types map array
* If $className is omitted it will return mapped class for $type
*
* Deprecated: The usage of $type as \Cake\Database\Type[] is deprecated. Please always use string[] if you pass an array
* as first argument.
*
* @param string|string[]|\Cake\Database\Type[]|null $type If string name of type to map, if array list of arrays to be mapped
* @param string|\Cake\Database\Type|null $className The classname or object instance of it to register.
* @return array|string|null If $type is null then array with current map, if $className is null string

0 comments on commit b94474d

Please sign in to comment.
You can’t perform that action at this time.