updated-packages
This commit is contained in:
80
vendor/php-webdriver/webdriver/lib/Remote/RemoteStatus.php
vendored
Normal file
80
vendor/php-webdriver/webdriver/lib/Remote/RemoteStatus.php
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
namespace Facebook\WebDriver\Remote;
|
||||
|
||||
/**
|
||||
* Represents status of remote end
|
||||
*
|
||||
* @see https://www.w3.org/TR/webdriver/#status
|
||||
*/
|
||||
class RemoteStatus
|
||||
{
|
||||
/** @var bool */
|
||||
protected $isReady;
|
||||
/** @var string */
|
||||
protected $message;
|
||||
/** @var array */
|
||||
protected $meta = [];
|
||||
|
||||
/**
|
||||
* @param bool $isReady
|
||||
* @param string $message
|
||||
*/
|
||||
protected function __construct($isReady, $message, array $meta = [])
|
||||
{
|
||||
$this->isReady = (bool) $isReady;
|
||||
$this->message = (string) $message;
|
||||
|
||||
$this->setMeta($meta);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $responseBody
|
||||
* @return RemoteStatus
|
||||
*/
|
||||
public static function createFromResponse(array $responseBody)
|
||||
{
|
||||
$object = new static($responseBody['ready'], $responseBody['message'], $responseBody);
|
||||
|
||||
return $object;
|
||||
}
|
||||
|
||||
/**
|
||||
* The remote end's readiness state.
|
||||
* False if an attempt to create a session at the current time would fail.
|
||||
* However, the value true does not guarantee that a New Session command will succeed.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isReady()
|
||||
{
|
||||
return $this->isReady;
|
||||
}
|
||||
|
||||
/**
|
||||
* An implementation-defined string explaining the remote end's readiness state.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMessage()
|
||||
{
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Arbitrary meta information specific to remote-end implementation.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getMeta()
|
||||
{
|
||||
return $this->meta;
|
||||
}
|
||||
|
||||
protected function setMeta(array $meta)
|
||||
{
|
||||
unset($meta['ready'], $meta['message']);
|
||||
|
||||
$this->meta = $meta;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user