Skip to content

Deprecate CallFlow Title usage #193

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

Merged
merged 1 commit into from
Apr 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion examples/voice-call-flows-create.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

$messageBird = new \MessageBird\Client('YOUR_ACCESS_KEY'); // Set your own API access key here.
$callFlow = new \MessageBird\Objects\Voice\CallFlow();
$callFlow->title = 'Foobar';
$step = new \MessageBird\Objects\Voice\Step();
$step->action = 'say';
$step->options = [
Expand Down
1 change: 0 additions & 1 deletion examples/voice-call-flows-update.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

$messageBird = new \MessageBird\Client('YOUR_ACCESS_KEY'); // Set your own API access key here.
$callFlow = new \MessageBird\Objects\Voice\CallFlow();
$callFlow->title = 'Foobar updated';

try {
$result = $messageBird->voiceCallFlows->update($callFlow, '21e5fc51-3285-4f41-97fd-cd1785ab54f8');
Expand Down
1 change: 0 additions & 1 deletion examples/voice-calls-create.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
$call->source = '31971234567';
$call->destination = '31612345678';
$callFlow = new \MessageBird\Objects\Voice\CallFlow();
$callFlow->title = 'Say message';
$step = new \MessageBird\Objects\Voice\Step();
$step->action = 'say';
$step->options = [
Expand Down
7 changes: 7 additions & 0 deletions src/MessageBird/Objects/Voice/CallFlow.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class CallFlow extends Base
* The title of the call flow
*
* @var string
* @deprecated
*/
public $title;
/**
Expand Down Expand Up @@ -41,6 +42,12 @@ class CallFlow extends Base
*/
protected $updatedAt;

function __construct() {
if ($this->title == null) {
unset($this->title);
}
}

/**
* @inheritdoc
*/
Expand Down
4 changes: 1 addition & 3 deletions tests/Integration/Voice/VoiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,6 @@ public function testReadVoiceCallFlow(): void
public function testCreateVoiceCallFlow(): void
{
$callFlow = new CallFlow();
$callFlow->title = 'Foobar';
$callFlow->steps = [
[
'action' => 'transfer',
Expand All @@ -365,7 +364,6 @@ public function testCreateVoiceCallFlow(): void
"data": [
{
"id": "de3ed163-d5fc-45f4-b8c4-7eea7458c635",
"title": "Forward call to 31612345678",
"steps": [
{
"id": "3538a6b8-5a2e-4537-8745-f72def6bd393",
Expand Down Expand Up @@ -397,7 +395,7 @@ public function testCreateVoiceCallFlow(): void
"POST",
'call-flows',
null,
'{"title":"Foobar","steps":[{"action":"transfer","options":{"destination":"31612345678"}}]}'
'{"steps":[{"action":"transfer","options":{"destination":"31612345678"}}]}'
);
$this->client->voiceCallFlows->create($callFlow);
}
Expand Down