110111112113114115116117118119120121122123124125126127128 * @param mixed $value input value
* @return mixed converted value
* @since 2.0.3
*/
protected function typecast($value)
{
if ($value === '' && $this->type !== Schema::TYPE_TEXT && $this->type !== Schema::TYPE_STRING && $this->type !== Schema::TYPE_BINARY && $this->type !== Schema::TYPE_CHAR) {
return null;
}
if ($value === null || gettype($value) === $this->phpType || $value instanceof Expression) {
return $value;
}
switch ($this->phpType) {
case 'resource':
case 'string':
if (is_resource($value)) {
return $value;
}
if (is_float($value)) {