Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TwiML/Voice/Gather::setInput() has wrong doc type for $input #778

Open
stevebauman opened this issue May 4, 2023 · 1 comment · May be fixed by #779
Open

TwiML/Voice/Gather::setInput() has wrong doc type for $input #778

stevebauman opened this issue May 4, 2023 · 1 comment · May be fixed by #779
Labels
status: help wanted requesting help from the community type: bug bug in the library

Comments

@stevebauman
Copy link

The documented $input parameter for the Gather::setInput() method says it should contain an array of strings:

/**
* 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>
@AsabuHere
Copy link
Contributor

Hello @stevebauman ,

Thanks for the heads up!

This issue has been added to our internal backlog to be prioritised. Pull requests and +1s on the issue summary will help it move up the backlog.

@AsabuHere AsabuHere added type: bug bug in the library status: help wanted requesting help from the community labels May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: help wanted requesting help from the community type: bug bug in the library
Projects
None yet
2 participants