PAGI\Client\Result\Result::__construct PHP Method

__construct() public method

Constructor. Will parse the data that came from agi.
public __construct ( string $line ) : void
$line string Result literal as came from agi.
return void
    public function __construct($line)
    {
        $this->line = $line;
        $this->result = false;
        $this->data = false;
        $response = explode(' ', $line);
        $this->code = $response[0];
        $this->result = explode('=', $response[1]);
        if (isset($this->result[1])) {
            $this->result = $this->result[1];
        }
        if (isset($response[2])) {
            unset($response[0]);
            unset($response[1]);
            $this->data = implode(' ', $response);
        }
    }