Skip to content

Commit 591ce28

Browse files
committed
Fix InputFieldState passing for Keyboard Bogdaan#99 by: oleh-yudin-ua/viber-bot-php
1 parent a70d8f1 commit 591ce28

File tree

3 files changed

+42
-3
lines changed

3 files changed

+42
-3
lines changed

composer.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{
2-
"name": "bogdaan/viber-bot-php",
2+
"name": "purplebug/viber-bot-php",
33
"description": "Php bot interface to work with Viber API",
4-
"keywords": ["viber", "im", "bot"],
4+
"keywords": [
5+
"viber",
6+
"im",
7+
"bot"
8+
],
59
"type": "library",
610
"license": "MIT",
711
"authors": [
@@ -23,4 +27,4 @@
2327
"phpunit/phpunit": "^4.8",
2428
"monolog/monolog": "^1.22"
2529
}
26-
}
30+
}

src/Api/Keyboard.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public function toArray()
6060
'Buttons' => $this->getButtonsApiArray(),
6161
'BgColor' => $this->getBgColor(),
6262
'DefaultHeight' => $this->getDefaultHeight(),
63+
'InputFieldState' => $this->getInputFieldState(),
6364
];
6465
}
6566

src/Api/Keyboard/Button.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,15 @@ class Button extends Entity
9595
*/
9696
protected $Image;
9797

98+
/**
99+
* Type of scaling the bounds of an image to the bounds of the view.
100+
*
101+
* Avail: crop, fill, fit
102+
*
103+
* @var string
104+
*/
105+
protected $ImageScaleType;
106+
98107
/**
99108
* Text to be displayed on the button. Can contain some HTML tags.
100109
*
@@ -160,6 +169,7 @@ public function toArray()
160169
'ActionType' => $this->getActionType(),
161170
'ActionBody' => $this->getActionBody(),
162171
'Image' => $this->getImage(),
172+
'ImageScaleType' => $this->getImageScaleType(),
163173
'Text' => $this->getText(),
164174
'TextVAlign' => $this->getTextVAlign(),
165175
'TextHAlign' => $this->getTextHAlign(),
@@ -385,6 +395,30 @@ public function setImage($Image)
385395
return $this;
386396
}
387397

398+
/**
399+
* Get the value of image scaling type.
400+
*
401+
* @return string
402+
*/
403+
public function getImageScaleType()
404+
{
405+
return $this->ImageScaleType;
406+
}
407+
408+
/**
409+
* Set the value of image scaling type.
410+
*
411+
* @param string ImageScaleType
412+
*
413+
* @return self
414+
*/
415+
public function setImageScaleType($ImageScaleType)
416+
{
417+
$this->ImageScaleType = $ImageScaleType;
418+
419+
return $this;
420+
}
421+
388422
/**
389423
* Get the value of Text to be displayed on the button. Can contain some HTML tags.
390424
*

0 commit comments

Comments
 (0)