public function flip()
    {
        if (!$this->items) {
            return $this->createFrom([]);
        }
        try {
            return $this->createFrom(Thrower::call('array_flip', $this->items));
        } catch (ErrorException $e) {
            throw new LogicException('Only string and integer values can be flipped');
        }
    }
public function flip()
    {
        if (!$this->items) {
            return $this->createFrom([]);
        }
        try {
            return $this->createFrom(Thrower::call('array_flip', $this->items));
        } catch (ErrorException $e) {
            throw new LogicException('Only string and integer values can be flipped');
        }
    }
public function flip ( ) { if ( ! $ this -> items ) { return $ this -> createFrom ( [ ] ) ; } try { return $ this -> createFrom ( Thrower :: call ( 'array_flip' , $ this -> items ) ) ; } catch ( ErrorException $ e ) { throw new LogicException ( 'Only string and integer values can be flipped' ) ; } }
Returns a bag with all keys exchanged with their associated values.

If a value has several occurrences, the latest key will be used as its value, and all others will be lost.

@throws LogicException when values are not strings or integers

@return static
Returns a bag with all keys exchanged with their associated values .