-
Notifications
You must be signed in to change notification settings - Fork 580
Open
Labels
status: help wantedrequesting help from the communityrequesting help from the communitytype: bugbug in the librarybug in the library
Description
The documented $input
parameter for the Gather::setInput()
method says it should contain an array of strings:
twilio-php/src/Twilio/TwiML/Voice/Gather.php
Lines 56 to 63 in 6d1f88c
/** | |
* Add Input attribute. | |
* | |
* @param string[] $input Input type Twilio should accept | |
*/ | |
public function setInput($input): self { | |
return $this->setAttribute('input', $input); | |
} |
However, this is not the case, as it should accept a single string only, according to the documentation:
https://www.twilio.com/docs/voice/twiml/gather#input
Code Example:
<?php
require_once './vendor/autoload.php';
use Twilio\TwiML\VoiceResponse;
$response = new VoiceResponse();
$gather = $response->gather(['input' => 'speech', 'action' => '/completed']);
$gather->say('Welcome to Twilio, please tell us why you\'re calling');
echo $response;
Expected XML Output:
<?xml version="1.0" encoding="UTF-8"?>
<!-- page located at http://example.com/simple_gather.xml -->
<Response>
<Gather input="speech" action="/completed">
<Say>Welcome to Twilio, please tell us why you're calling</Say>
</Gather>
</Response>
Metadata
Metadata
Assignees
Labels
status: help wantedrequesting help from the communityrequesting help from the communitytype: bugbug in the librarybug in the library