Skip to content
Permalink
Browse files

Fix up late static binding for a consistent internal class usage.

  • Loading branch information...
dereuromark committed Dec 2, 2017
1 parent 5a5d2b7 commit d01efaa941fea4a2445fc2d6a6dac1fabf7a4085
Showing with 10 additions and 10 deletions.
  1. +10 −10 src/Database/Type.php
@@ -121,7 +121,7 @@ public static function build($name)
public static function buildAll()
{
$result = [];
foreach (self::$_types as $name => $type) {
foreach (static::$_types as $name => $type) {
$result[$name] = isset(static::$_builtTypes[$name]) ? static::$_builtTypes[$name] : static::build($name);
}
@@ -153,19 +153,19 @@ public static function set($name, Type $instance)
public static function map($type = null, $className = null)
{
if ($type === null) {
return self::$_types;
return static::$_types;
}
if (is_array($type)) {
self::$_types = $type;
static::$_types = $type;
return null;
}
if ($className === null) {
return isset(self::$_types[$type]) ? self::$_types[$type] : null;
return isset(static::$_types[$type]) ? static::$_types[$type] : null;
}
self::$_types[$type] = $className;
unset(self::$_builtTypes[$type]);
static::$_types[$type] = $className;
unset(static::$_builtTypes[$type]);
}
/**
@@ -175,8 +175,8 @@ public static function map($type = null, $className = null)
*/
public static function clear()
{
self::$_types = [];
self::$_builtTypes = [];
static::$_types = [];
static::$_builtTypes = [];
}
/**
@@ -228,8 +228,8 @@ protected function _basicTypeCast($value)
if ($value === null) {
return null;
}
if (!empty(self::$_basicTypes[$this->_name])) {
$typeInfo = self::$_basicTypes[$this->_name];
if (!empty(static::$_basicTypes[$this->_name])) {
$typeInfo = static::$_basicTypes[$this->_name];
if (isset($typeInfo['callback'])) {
return $typeInfo['callback']($value);
}

0 comments on commit d01efaa

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