Splits a key-value pair

@return string[]
@throws InvalidArgumentException
482752
private function splitKeyValuePair(string $pair): array
    {
        $option = explode('=', $pair);
        if (count($option) !== 2) {
            throw new InvalidArgumentException(
                sprintf('"%s" is not a valid query or parameter.', $pair)
            );
        }

        return $option;
    }
1185162
public function split() : array
    {
        $stlArray = $this->getStl()->toArray();
        $facets = $stlArray["facets"];

        $objArray = array();
        $vertex = $facets[0];
        unset($facets[0]);

        $current = 0;
        $objArray[$current] = array($vertex);
        while (count($facets) != 0) {
            $this->findNeighbour(
                $vertex,
                $objArray[$current],
                $facets
            );
            $vertex = array_pop($facets);
            $current++;
            if ($vertex) {
                $objArray[$current] = array($vertex);
            }
        }

        $stlObjects = array();
        foreach ($objArray as $key => $object) {
            $stlObjects[] = STL::fromArray(array(
                "name" => $this->getStl()->getSolidName() . $key,
                "facets" => $object
            ));
        }

        return $stlObjects;
    }
86962
protected function explode($commaSeparatedValues)
    {
        if (null === $commaSeparatedValues) {
            return array();
        }

        $array = explode(',', $commaSeparatedValues);

        if (array_walk(
            $array,
            function (&$item) {
            $item = strtoupper(trim($item));
            }
        )) {
            return $array;
        }

        return array();
    }
1072984
public function getTransformations() {
        if ($this->transformations === null) {
            $this->transformations = [];

            $transformations = $this->query->get('t', []);

            if (!is_array($transformations)) {
                throw new InvalidArgumentException('Transformations must be specifed as an array', 400);
            }

            foreach ($transformations as $transformation) {
                if (!is_string($transformation)) {
                    throw new InvalidArgumentException('Invalid transformation', 400);
                }

                // See if the transformation has any parameters
                $pos = strpos($transformation, ':');
                $urlParams = '';

                if ($pos === false) {
                    // No params exist
                    $name = $transformation;
                } else {
                    list($name, $urlParams) = explode(':', $transformation, 2);
                }

                // Initialize params for the transformation
                $params = [];

                // Loop through the parameter string and assign params to an array
                $offset = 0;
                $pattern = '#(\w+)=(?:(.+?),\w+=|(.+?$))#';
                while (preg_match($pattern, $urlParams, $matches, PREG_OFFSET_CAPTURE, $offset)) {
                    $offset = $matches[2][1];
                    $paramName = $matches[1][0];
                    $paramValue = isset($matches[3]) ? $matches[3][0] : $matches[2][0];
                    $params[$paramName] = $paramValue;
                }

                $this->transformations[] = [
                    'name'   => $name,
                    'params' => $params,
                ];
            }
        }

        return $this->transformations;
    }
97289
public function toArray(): array
    {
        $type = $this->getType();

        if (empty($type)) {
            throw new InvalidException('Type has to be set');
        }

        return [$type->getName() => $this->_mapping];
    }
197171
public static function getAllIniPartCacheSubKeys() : array
    {
        $subKeys = [];
        $chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];

        foreach ($chars as $charOne) {
            foreach ($chars as $charTwo) {
                foreach ($chars as $charThree) {
                    $subKeys[] = $charOne . $charTwo . $charThree;
                }
            }
        }

        return $subKeys;
    }
598742
protected function parseKey($key, $value) {
		$point = strpos($key, '.');
		
		if ($point === false) {
			if (is_array($value)) {
				return [$key => array_map(['ZExt\Components\Std', 'parseValue'], $value)];
			}
			
			return [$key => Std::parseValue($value)];
		}
		
		$keyCurrent = trim(substr($key, 0, $point));
		$keyRemains = trim(substr($key, $point + 1));

		if (! isset($keyCurrent[0], $keyRemains[0])) {
			throw new InvalidIniKey('Invalid definition of the key "' . $key . '"');
		}

		return [$keyCurrent => $this->parseKey($keyRemains, $value)];
	}
322911
public function keySet(): array {
        $keySet = [];
        /** @var SinglyLinkedList $list */
        foreach ($this->bucket as $list) {
            if (null === $list) {
                continue;
            }
            /** @var Node $head */
            $head = $list->getHead();
            while ($head !== null) {
                $keySet[] = $head->getKey();
                $head = $head->getNext();
            }
        }
        return $keySet;
    }
714377
public function fold(int $k = 3) : array
    {
        if ($k < 2) {
            throw new InvalidArgumentException('Cannot create less than 2'
                . " folds, $k given.");
        }

        $samples = $this->samples;

        $n = (int) floor(count($samples) / $k);

        $folds = [];

        for ($i = 0; $i < $k; $i++) {
            $folds[] = self::quick(array_splice($samples, 0, $n));
        }

        return $folds;
    }
968295
public function fold(int $k = 10) : array
    {
        if ($k < 2) {
            throw new InvalidArgumentException('Cannot create less than'
                . " 2 folds, $k given.");
        }

        $n = (int) floor($this->numRows() / $k);

        $folds = [];

        for ($i = 0; $i < $k; $i++) {
            $offset = $i * $n;

            $samples = array_slice($this->samples, $offset, $n);
            $labels = array_slice($this->labels, $offset, $n);

            $folds[] = self::quick($samples, $labels);
        }

        return $folds;
    }
212224
public static function splitKeys(
        EncryptionKey $master,
        string $salt,
        BaseConfig $config
    ): array {
        $binary = $master->getRawKeyMaterial();
        return [
            CryptoUtil::hkdfBlake2b(
                $binary,
                \SODIUM_CRYPTO_SECRETBOX_KEYBYTES,
                (string) $config->HKDF_SBOX,
                $salt
            ),
            CryptoUtil::hkdfBlake2b(
                $binary,
                \SODIUM_CRYPTO_AUTH_KEYBYTES,
                (string) $config->HKDF_AUTH,
                $salt
            )
        ];
    }
25828
public function split($separator = null)
    {
        if (is_null($separator) === true) {
            return [$this->subject];
        }

        return new JArray(explode($separator, $this->subject));
    }
856331
private static List<String> splitProperty(String propertyString) throws InvalidCommandException {
    List<String> tokens = ImmutableList.copyOf(Splitter.on('=').limit(2).split(propertyString));
    if (tokens.size() != 2) {
      throw new InvalidCommandException("no '=' found in: " + propertyString);
    }
    return tokens;
  }
1246043
public function toMappedArray()
    {
        $values = $this->toArray();
        $mappedValues = [];
        foreach ($values as $key => $value) {
            $mappedValues[$key] = $this->readMapped($key);
        }

        return $mappedValues;
    }
1202837
public static function split(string $name): array
    {
        $parts = explode(self::JSON_DELIMITER, $name, 2);
        $jsonPath = count($parts) === 2 ? explode(self::JSON_DELIMITER, end($parts)) : [];

        $relationParts = explode(self::RELATION_DELIMITER, $parts[0]);

        return [
            array_slice($relationParts, 0, -1),
            end($relationParts),
            $jsonPath,
        ];
    }
954544
private function explodeKey(string $string): array
    {
        [$key, $tag] = \explode(self::SEPARATOR_TAG, $string . self::SEPARATOR_TAG);

        if ($key === self::HIERARCHY_SEPARATOR) {
            $parts = ['root'];
        } else {
            $parts = \explode(self::HIERARCHY_SEPARATOR, $key);
            // remove first element since it is always empty and replace it with 'root'
            $parts[0] = 'root';
        }

        foreach ($parts as &$level) {
            $level .= self::SEPARATOR_TAG . $tag;
        }

        return $parts;
    }
490078
protected static function explodeParameters($value, $key)
    {
        if (is_string($value)) {
            $value = self::explodeDotNotationKeys($value);
        }

        if (!is_null($key) && is_array($key)) {
            $key = self::explodeDotNotationKeys($key);
        }

        return [$value, $key];
    }