public static function replenishPositions(array &$items, $asLast = true, $force = false)
    {
        $position = self::getExtremePosition($items, $asLast);

        /*
         * Extreme position is unknown, but it's required?
         * Use 0 as default/start value
         */
        if (null === $position && $force) {
            $position = 0;
        }

        /*
         * Extreme position is unknown or there are no items to sort?
         * Nothing to do
         */
        if (null === $position || empty($items)) {
            return;
        }

        foreach ($items as &$item) {
            // Not sortable?
            if (!self::isSortable($item)) {
                continue;
            }

            // Sorted already (position has been set)?
            if (self::isSorted($item)) {
                continue;
            }

            // Calculate position
            if ($asLast) {
                ++$position;
            } else {
                --$position;
            }

            /*
             * It's an object?
             * Use proper method to set position
             */
            if (is_object($item)) {
                $item->setPosition($position);

                continue;
            }

            /*
             * It's an array
             * Use proper key to set position
             */
            $item[static::POSITION_KEY] = $position;
        }
    }