public function castInBuffer($limit, $type)
{
$castFunction = function ($value) use($limit) {
return abs($value) < $limit ? $value : $limit;
};
if (is_numeric($this->value) && abs($this->value) < $limit) {
return $castFunction($this->value);
}
return $this->handleMismatch($castFunction, $type);
}