src/Map.php
protected function reduceToBitmask($list)
    {
        $this->logger->debug('Swivel - reducing to bitmask.', compact('list'));

        return !is_array($list) ? $list : array_reduce($list, function ($mask, $index) {
            if ((int)$index == 0) {
                return $mask;
            }
            return $mask | (1 << ($index - 1));
        });
    }
protected function reduceToBitmask($list)
    {
        $this->logger->debug('Swivel - reducing to bitmask.', compact('list'));

        return !is_array($list) ? $list : array_reduce($list, function ($mask, $index) {
            if ((int)$index == 0) {
                return $mask;
            }
            return $mask | (1 << ($index - 1));
        });
    }
Reduce an array of integers to a bitmask if $list is an array.

Otherwise, this method will just return $list.

@param mixed $list

@return int bitmask