将值value插入到列表key当中，位于值pivot之前。
@param $pivot mixed 支点(列表中存在的元素)
@param $value mixed 要插入的数据
@return int    如果命令执行成功，返回插入操作完成之后，列表的长度。如果没有找到pivot，返回-1。如果key不存在或为空列表，返回0。
488974
public function insertBefore($pivot, $value): int
    {
        return $this->handle->lInsert($this->name, \redis::BEFORE, $pivot, $value);
    }
1226566
protected function _validate_int($value)
    {
        if (is_int($value)) {
            return $value;
        }

        return preg_match('#^[+-]?\d+$#', $value) ? (int)$value : null;
    }
63610
public function pull($column, $value = null)
    {
        $this->compileWheres();
        $result = $this->query->update([
            $column => r\row($column)->difference([$value]),
        ])->run();

        return 0 == (int) $result['errors'];
    }
704643
public function convertToDatabaseValue($value, AbstractPlatform $platform): int
    {
        \assert('is_int($value)');
        if (!isset($this->getValues()[$value])) {
            throw new \InvalidArgumentException('Invalid type.');
        }
        return $value;
    }
301865
public function count($value)
    {
        if (is_array($value) === true || $value instanceof Countable) {
            return count($value);
        } elseif ($value instanceof IteratorAggregate) {
            // Note: getIterator() returns a Traversable, not an Iterator
            // thus rewind() and valid() methods may not be present
            return iterator_count($value->getIterator());
        } elseif ($value instanceof Iterator) {
            if ($value instanceof Generator) {
                return 1;
            }
            return iterator_count($value);
        } elseif ($value instanceof PDOStatement) {
            return $value->rowCount();
        } elseif ($value instanceof Traversable) {
            return iterator_count($value);
        } elseif ($value instanceof ArrayAccess) {
            if ($value->offsetExists(0)) {
                return 1;
            }
        } elseif (is_object($value)) {
            return count($value);
        }
        return 0;
    }
93431
public static function intValue($value): bool
    {
        if (!is_numeric($value)) {
            return false;
        }

        return strval(intval($value)) == $value;
    }
983071
protected function whenPivotLoadedAs($accessor, $table, $value, $default = null)
    {
        if (func_num_args() === 3) {
            $default = new MissingValue;
        }

        return $this->when(
            $this->resource->$accessor &&
            ($this->resource->$accessor instanceof $table ||
            $this->resource->$accessor->getTable() === $table),
            ...[$value, $default]
        );
    }
262924
public function decode(string $value): ?int
    {
        $value = $this->hashids->decode($value);

        if (is_array($value) && sizeof($value) > 0) {
            return $value[0];
        } else {
            return null;
        }
    }
540549
private int countPivots(Type.Field[] pivots) {
		int count = 0;
		for(int i=0;i!=pivots.length;++i) {
			if(pivots[i] != null) {
				count = count + 1;
			}
		}
		return count;
	}
1281498
public static function parseSize($value)
    {
        $l = substr($value, -1);

        if ($l === 'b' || $l === 'B') {
            return ((int)substr($value, 0, -1));
        }

        if ($l === 'k') {
            return ((int)substr($value, 0, -1) * 1000);
        }

        if ($l === 'K') {
            return ((int)substr($value, 0, -1) * 1024);
        }

        if ($l === 'm') {
            return ((int)substr($value, 0, -1) * 1000 * 1000);
        }

        if ($l === 'M') {
            return ((int)substr($value, 0, -1) * 1024 * 1024);
        }

        if ($l === 'g') {
            return ((int)substr($value, 0, -1) * 1000 * 1000 * 1000);
        }

        if ($l === 'G') {
            return ((int)substr($value, 0, -1) * 1024 * 1024 * 1024);
        }

        return (int)$value;
    }
474677
public function increment($key, $value = 1)
    {
        if ($this->exists($key)) {
            return self::$redis->incrBy($key, $value);
        } else {
            $this->set($key, $value);

            return $value;
        }
    }
244656
public function increment($key, $value = 1)
    {
        $raw = $this->getPayload($key);

        return tap(
            ((int) $raw['data']) + $value, function ($newValue) use ($key, $raw) {
                $this->put($key, $newValue, $raw['time']);
            }
        );
    }
514663
public function setValue($value)
	{
		$value = (int) $value;
		$value = parent::setValue($value);
		return $value;
	}
702552
public function value($column = 0)
    {
        $row = $this->row();
        if ($row) {
            return is_int($column) ? array_values($row)[$column] : $row[$column];
        }

        return false;
    }
902916
public static function castInt($value): int
    {
        if ($value !== null && !is_scalar($value)) {
            throw new InvalidArgumentException('Value could not be parsed to integer');
        }

        return (int)$value;
    }
1080327
public static function integer($value){

		$value = static::_nullValue($value);

		if($value !== null){

			$value = (int) $value;
		}

		return $value;
	}
637586
public function increment($key, $value = 1)
    {
        if (! isset($this->storage[$key])) {
            $this->forever($key, $value);

            return $this->storage[$key]['value'];
        }

        $this->storage[$key]['value'] = ((int) $this->storage[$key]['value']) + $value;

        return $this->storage[$key]['value'];
    }