__construct() public method

Constructor.
public __construct ( PAGI\Client\Result\IResult $result ) : void
$result PAGI\Client\Result\IResult Result to decorate.
return void
Exemplo n.º 1
0
 /**
  * Constructor.
  *
  * @param IResult $result Result to decorate.
  */
 public function __construct(IResult $result)
 {
     parent::__construct($result);
     // Reset timeout flag. This is because wait-for-digit returns 0 on timeout
     // and the result is the ascii char of the digit read, while other read
     // functions return the digits and (timeout) on data to signal a timeout.
     $this->timeout = false;
     $this->digits = $result->getResult();
     if ($result->hasData()) {
         $this->timeout = strpos($result->getData(), '(timeout)') !== false;
     }
 }