public function random($quantity = 1)
    {
        $quantity = $this->getIntegerable($quantity);

        $result = new static;

        while($quantity--)
        {
            $result->push($this->items[$this->randomKey()]);
        }

        return $result->length() === 1 ? $result->first() : $result;
    }
public function random($quantity = 1)
    {
        $quantity = $this->getIntegerable($quantity);

        $result = new static;

        while($quantity--)
        {
            $result->push($this->items[$this->randomKey()]);
        }

        return $result->length() === 1 ? $result->first() : $result;
    }
public function random ( $ quantity = 1 ) { $ quantity = $ this -> getIntegerable ( $ quantity ) ; $ result = new static ; while ( $ quantity -- ) { $ result -> push ( $ this -> items [ $ this -> randomKey ( ) ] ) ; } return $ result -> length ( ) === 1 ? $ result -> first ( ) : $ result ; }
Return pseudo-random item from Container.

@param int|IntegerContract $quantity
@return array
Return pseudo - random item from Container .