src/collections/Variables.php
public function indexBy($callback)
    {
        $keys = array_map($callback, $this->value);
        $value = array_combine($keys, $this->value);
        return $this->setValue($value);
    }
public function indexBy($callback)
    {
        $keys = array_map($callback, $this->value);
        $value = array_combine($keys, $this->value);
        return $this->setValue($value);
    }
public function indexBy ( $ callback ) { $ keys = array_map ( $ callback , $ this -> value ) ; $ value = array_combine ( $ keys , $ this -> value ) ; return $ this -> setValue ( $ value ) ; }
Maps values to keys using callback
@param callable $callback
@return static
Maps values to keys using callback