public function combineKeys(iterable $keys): self
    {
        if (count($keys) != count($this->items)) {
            $this->doThrow('Invalid input for combineKeys, number of items does not match.', $keys);
        }
        $collection = Factory::create();
        $this->rewind();
        foreach ($keys as $key) {
            $collection->set($key, $this->current());
            $this->next();
        }
        $this->rewind();

        return $collection;
    }
public function combineKeys(iterable $keys): self
    {
        if (count($keys) != count($this->items)) {
            $this->doThrow('Invalid input for combineKeys, number of items does not match.', $keys);
        }
        $collection = Factory::create();
        $this->rewind();
        foreach ($keys as $key) {
            $collection->set($key, $this->current());
            $this->next();
        }
        $this->rewind();

        return $collection;
    }
public function combineKeys ( iterable $ keys ) : self { if ( count ( $ keys ) != count ( $ this -> items ) ) { $ this -> doThrow ( 'Invalid input for combineKeys, number of items does not match.' , $ keys ) ; } $ collection = Factory :: create ( ) ; $ this -> rewind ( ) ; foreach ( $ keys as $ key ) { $ collection -> set ( $ key , $ this -> current ( ) ) ; $ this -> next ( ) ; } $ this -> rewind ( ) ; return $ collection ; }
Opposite of Combine
It keeps the values of the current Collection and assign new keys.
Opposite of Combine It keeps the values of the current Collection and assign new keys .