Swaps the first 48 bits with the last 48 bits

@param array $components An array of UUID components (the UUID exploded on its dashes)

@return void
503183
protected function swapTimestampAndRandomBits(array &$components)
    {
        $last48Bits = $components[4];
        if (count($components) == 6) {
            $last48Bits = $components[5];
            $components[5] = $components[0] . $components[1];
        } else {
            $components[4] = $components[0] . $components[1];
        }

        $components[0] = substr($last48Bits, 0, 8);
        $components[1] = substr($last48Bits, 8, 4);
    }
762088
public function addExtraKeys(array $values)
    {
        foreach ($values as $key => $value) {
            $this->setExtraKey($key, $value);
        }
    }
475777
private function allowedUpdate($component, $hits)
  {
    $globalCheck    = ($this->getCounter() + $hits) <= $this->getGlobalThreshold();
    $componentCheck = true;
    if (null !== $this->getComponentThreshold()) {
      $componentCheck = ($this->getComponentCounter($component) + $hits) <= $this->getComponentThreshold();
    }
    return $globalCheck && $componentCheck;
  }
1165845
public function setParts(array $parts)
    {
        $this->parts = array();

        foreach($parts as $part) {
            $this->add($part);
        }
        return $this;
    }
628314
private function doSetBinaryBitsetLeBin($bitset): void
    {
        $size   = \strlen($this->bitset);
        $sizeIn = \strlen($bitset);

        if ($sizeIn < $size) {
            // add "\0" if the given bitset is not long enough
            $bitset .= \str_repeat("\0", $size - $sizeIn);
        } elseif ($sizeIn > $size) {
            if (\ltrim(\substr($bitset, $size), "\0") !== '') {
                throw new InvalidArgumentException('out-of-range bits detected');
            }
            $bitset = \substr($bitset, 0, $size);
        }

        // truncate out-of-range bits of last byte
        $lastByteMaxOrd = $this->enumerationCount % 8;
        if ($lastByteMaxOrd !== 0) {
            $lastByte         = $bitset[-1];
            $lastByteExpected = \chr((1 << $lastByteMaxOrd) - 1) & $lastByte;
            if ($lastByte !== $lastByteExpected) {
                throw new InvalidArgumentException('out-of-range bits detected');
            }

            $this->bitset = \substr($bitset, 0, -1) . $lastByteExpected;
        }

        $this->bitset = $bitset;
    }
358655
public function setComponents(array $components)
    {
        foreach ($components as $id => $properties) {
            $this->setComponent($id, $properties);
        }
    }
85147
public function setExtraKeys(array $values)
    {
        $this->extra = array();

        foreach ($values as $key => $value) {
            $this->setExtraKey($key, $value);
        }
    }
1054697
protected function setUriParts(array $parts)
    {
        foreach ($parts as $key => $value) {
            if (!method_exists($this, "set$key")) {
                continue;
            }
            $this->{"set$key"}($value);
        }
    }
1285771
public function deactivate_component( $component ) {

		if ( $this->is_component_active( $component ) ) {
			if ( isset( $this->components[ $component ] ) ) {
				$this->settings['components'][ $component ] = 0;

				$this->update_settings( $this->settings );
			}
		}

	}
864716
public static function swapEndian64($s)
    {
        return $s[7] . $s[6] . $s[5] . $s[4] . $s[3] . $s[2] . $s[1] . $s[0];
    }
1245502
public function setComponents($components)
  {
    if (ThrottlerHelper::validateComponents($components)
        && !$this->isActive())
    {
      $this->components = $components;
      return true;
    }
    return false;
  }
544782
private function swap(int $a, int $b)
    {
        $temp           = $this->heap[$a];
        $this->heap[$a] = $this->heap[$b];
        $this->heap[$b] = $temp;
    }
434369
public static function cleanComponents()
    {
        foreach (self::$components as $name => $component)
        {
            if ( ! $component->persistence)
            {
                self::$components[$name] = null;
                unset(self::$components[$name]);
            }
        }
    }
502909
public function setTags($tags)
    {
        foreach ($tags as $key => $value) {
            $this->setTag($key, $value);
        }
    }
850653
function attachAndRenderSet (array $components)
  {
    $this->attach ($components);
    foreach ($components as $c)
      $c->run ();
  }
255913
public static function moveDownToRootForm($bits) {
		$tones = self::bits2Tones($bits);
		$rootedbits = self::rotateBitmask($bits, 1, $tones[0]);
		return $rootedbits;
	}
1051757
public function swap(int $index1, int $index2) : void
    {
        if ($index1 !== $index2) {
            $value = $this[$index1];
            $this[$index1] = $this[$index2];
            $this[$index2] = $value;
        }
    }