Contribution suggestion: function welement to WebDriverContainer.php

Contribution suggestion: function welement to WebDriverContainer.php (https://github.com/Element-34/php-webdriver/blob/master/PHPWebDriver/WebDriverContainer.php)

No milestone
No one is assigned

/*
Since everybody makes these waiting with custom functions or even uglier "sleeps", why not to add them into the core. Naming and particularities at your consideration. I did like this and it's working since just fine for me.
/
//*<<CODE**
public function welement($using, $value, $curl_opts = array(), $timeout = 30,$poll_frequency = 0.5) {

    $end_time = time() + $timeout;
    while(time() < $end_time) {
        try {
            $results = $this->curl(
                'POST',
                '/element',
                array(
                    'using' => $using,
                    'value' => $value),
                $curl_opts);
            if ($results) {
                return $this->webDriverElement($results['value']);
            }
        } catch (PHPWebDriver_NoSuchElementWebDriverError $e) {

        }
        usleep(intval($poll_frequency * 1000000));
    }
    throw new PHPWebDriver_TimeOutWebDriverError(
        sprintf(
            'Element wait timed out after %s',
            $timeout) . "\n\n");

}

//CODE>>

/* It's the second day i'm using php+ selenium, let me know if you find my ideas to be OK. */