Skip to content

Commit 7532f4b

Browse files
committed
Update code comments
1 parent dba29ad commit 7532f4b

File tree

1 file changed

+105
-0
lines changed

1 file changed

+105
-0
lines changed

api.php

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ function hash_equals($knownString, $userString)
5959
}
6060
}
6161

62+
/**
63+
* LINEAPI (Messaging API)
64+
* https://developers.line.biz/en/reference/messaging-api/
65+
*
66+
* This is the Messaging API for creating LINE Chat BOTs.
67+
*/
6268
class LINEAPI
6369
{
6470
/**
@@ -987,15 +993,37 @@ private function requestFactory($targetUri, $method, $data = array(), $decode =
987993
}
988994
}
989995

996+
/**
997+
* LINEMSG
998+
* https://developers.line.biz/en/reference/messaging-api/#message-objects
999+
*
1000+
* This is the wrapper for creating a message object.
1001+
*/
9901002
class LINEMSG
9911003
{
1004+
/**
1005+
* Quick reply
1006+
* https://developers.line.biz/en/reference/messaging-api/#quick-reply
1007+
*
1008+
* @param array $action
1009+
*
1010+
* @return array
1011+
*/
9921012
public static function QuickReply($actions)
9931013
{
9941014
return array("quickReply" => array(
9951015
"items" => $actions,
9961016
));
9971017
}
9981018

1019+
/**
1020+
* Text message
1021+
* https://developers.line.biz/en/reference/messaging-api/#text-message
1022+
*
1023+
* @param string $msgText
1024+
*
1025+
* @return array
1026+
*/
9991027
public static function Text($msgText)
10001028
{
10011029
return array(
@@ -1004,6 +1032,15 @@ public static function Text($msgText)
10041032
);
10051033
}
10061034

1035+
/**
1036+
* Sticker message
1037+
* https://developers.line.biz/en/reference/messaging-api/#sticker-message
1038+
*
1039+
* @param string $packageId
1040+
* @param string $stickerId
1041+
*
1042+
* @return array
1043+
*/
10071044
public static function Sticker($packageId, $stickerId)
10081045
{
10091046
return array(
@@ -1013,6 +1050,15 @@ public static function Sticker($packageId, $stickerId)
10131050
);
10141051
}
10151052

1053+
/**
1054+
* Image message
1055+
* https://developers.line.biz/en/reference/messaging-api/#image-message
1056+
*
1057+
* @param string $url
1058+
* @param string $preview_url (optional)
1059+
*
1060+
* @return array
1061+
*/
10161062
public static function Image($url, $preview_url = null)
10171063
{
10181064
if ($preview_url == null) {
@@ -1028,6 +1074,15 @@ public static function Image($url, $preview_url = null)
10281074
);
10291075
}
10301076

1077+
/**
1078+
* Video message
1079+
* https://developers.line.biz/en/reference/messaging-api/#video-message
1080+
*
1081+
* @param string $url
1082+
* @param string $preview_url
1083+
*
1084+
* @return array
1085+
*/
10311086
public static function Video($url, $preview_url)
10321087
{
10331088
return array(
@@ -1037,6 +1092,15 @@ public static function Video($url, $preview_url)
10371092
);
10381093
}
10391094

1095+
/**
1096+
* Audio message
1097+
* https://developers.line.biz/en/reference/messaging-api/#audio-message
1098+
*
1099+
* @param string $url
1100+
* @param integer $second (optional)
1101+
*
1102+
* @return array
1103+
*/
10401104
public static function Audio($url, $second = null)
10411105
{
10421106
if ($second == null) {
@@ -1052,6 +1116,17 @@ public static function Audio($url, $second = null)
10521116
);
10531117
}
10541118

1119+
/**
1120+
* Location message
1121+
* https://developers.line.biz/en/reference/messaging-api/#location-message
1122+
*
1123+
* @param string $title
1124+
* @param string $address
1125+
* @param double $latitude
1126+
* @param double $longitude
1127+
*
1128+
* @return array
1129+
*/
10551130
public static function Location($title, $address, $latitude, $longitude)
10561131
{
10571132
return array(
@@ -1063,6 +1138,18 @@ public static function Location($title, $address, $latitude, $longitude)
10631138
);
10641139
}
10651140

1141+
/**
1142+
* Imagemap message
1143+
* https://developers.line.biz/en/reference/messaging-api/#imagemap-message
1144+
*
1145+
* @param string $baseUrl
1146+
* @param string $altText
1147+
* @param integer $width
1148+
* @param integer $height
1149+
* @param array $action
1150+
*
1151+
* @return array
1152+
*/
10661153
public static function Imagemap($baseUrl, $altText, $width, $height, $action)
10671154
{
10681155
if (isset($action["type"])) {
@@ -1086,6 +1173,15 @@ public static function Imagemap($baseUrl, $altText, $width, $height, $action)
10861173
);
10871174
}
10881175

1176+
/**
1177+
* Template messages
1178+
* https://developers.line.biz/en/reference/messaging-api/#template-messages
1179+
*
1180+
* @param string $altText
1181+
* @param array $template
1182+
*
1183+
* @return array
1184+
*/
10891185
public static function Template($altText, $template)
10901186
{
10911187
foreach ($template as $num => $var) {
@@ -1100,6 +1196,15 @@ public static function Template($altText, $template)
11001196
);
11011197
}
11021198

1199+
/**
1200+
* Flex Message
1201+
* https://developers.line.biz/en/reference/messaging-api/#flex-message
1202+
*
1203+
* @param string $altText
1204+
* @param array $contents
1205+
*
1206+
* @return array
1207+
*/
11031208
public static function Flex($altText, $contents)
11041209
{
11051210
foreach ($contents as $num => $var) {

0 commit comments

Comments
 (0)