public function flip()
    {
        // get null valued data
        $unvaluedEntries = (clone $this)->filter(function ($value) {
            return !$value;
        })->keys();

        $collection = (clone $this)->filter();

        $this->setInternalValue(array_merge(array_flip($collection->toArray()), $unvaluedEntries->toArray()));

        return $this;
    }
public function flip()
    {
        // get null valued data
        $unvaluedEntries = (clone $this)->filter(function ($value) {
            return !$value;
        })->keys();

        $collection = (clone $this)->filter();

        $this->setInternalValue(array_merge(array_flip($collection->toArray()), $unvaluedEntries->toArray()));

        return $this;
    }
public function flip ( ) { // get null valued data $ unvaluedEntries = ( clone $ this ) -> filter ( function ( $ value ) { return ! $ value ; } ) -> keys ( ) ; $ collection = ( clone $ this ) -> filter ( ) ; $ this -> setInternalValue ( array_merge ( array_flip ( $ collection -> toArray ( ) ) , $ unvaluedEntries -> toArray ( ) ) ) ; return $ this ; }
Modify the collection with the keys and values of the current collection inverted

@return $this
Modify the collection with the keys and values of the current collection inverted