Permalink
Browse files

Support the latest LINE Messaging API

  • Loading branch information...
moznion committed Sep 29, 2016
1 parent b10bf76 commit e16d9ca416fcdc9c373a1b155b9fe521f99b6b1b
Showing with 6,115 additions and 3,717 deletions.
  1. +4 −4 .gitignore
  2. +3 −9 .travis.yml
  3. +3 −3 CONTRIBUTING.md
  4. +2 −2 LICENSE
  5. +12 −3 Makefile
  6. +97 −125 README.md
  7. +3 −4 composer.json
  8. +24 −0 devtool/check_copyright.sh
  9. +1 −4 examples/EchoBot/.gitignore
  10. +2 −2 examples/EchoBot/LICENSE
  11. +7 −5 examples/EchoBot/README.md
  12. +8 −3 examples/EchoBot/composer.json
  13. +12 −7 examples/EchoBot/public/index.php
  14. +50 −0 examples/EchoBot/src/LINEBot/EchoBot/Dependency.php
  15. +79 −0 examples/EchoBot/src/LINEBot/EchoBot/Route.php
  16. +43 −0 examples/EchoBot/src/LINEBot/EchoBot/Setting.php
  17. +0 −39 examples/EchoBot/src/dependencies.php
  18. +0 −133 examples/EchoBot/src/routes.php
  19. +0 −32 examples/EchoBot/src/settings.php
  20. +4 −0 examples/KitchenSink/.gitignore
  21. +201 −0 examples/KitchenSink/LICENSE
  22. +68 −0 examples/KitchenSink/README.md
  23. +19 −0 examples/KitchenSink/composer.json
  24. +11 −0 examples/KitchenSink/public/.htaccess
  25. +32 −0 examples/KitchenSink/public/index.php
  26. BIN examples/KitchenSink/public/static/buttons/1040.jpg
  27. BIN examples/KitchenSink/public/static/rich/1040
  28. BIN examples/KitchenSink/public/static/rich/240
  29. BIN examples/KitchenSink/public/static/rich/300
  30. BIN examples/KitchenSink/public/static/rich/460
  31. BIN examples/KitchenSink/public/static/rich/700
  32. +17 −0 examples/KitchenSink/run.sh
  33. +50 −0 examples/KitchenSink/src/LINEBot/KitchenSink/Dependency.php
  34. +6 −3 ...Exception/LINEBotAPIException.php → examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler.php
  35. +54 −0 examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/BeaconEventHandler.php
  36. +51 −0 examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/FollowEventHandler.php
  37. +54 −0 examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/JoinEventHandler.php
  38. +54 −0 examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/LeaveEventHandler.php
  39. +77 −0 examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/AudioMessageHandler.php
  40. +75 −0 examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/ImageMessageHandler.php
  41. +61 −0 examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/LocationMessageHandler.php
  42. +55 −0 examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/StickerMessageHandler.php
  43. +195 −0 examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/TextMessageHandler.php
  44. +13 −27 ...hp → examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/Util/UrlBuilder.php
  45. +76 −0 examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/VideoMessageHandler.php
  46. +54 −0 examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/PostbackEventHandler.php
  47. +55 −0 examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/UnfollowEventHandler.php
  48. +129 −0 examples/KitchenSink/src/LINEBot/KitchenSink/Route.php
  49. +43 −0 examples/KitchenSink/src/LINEBot/KitchenSink/Setting.php
  50. +0 −71 examples/SendingSample/sample.php
  51. +0 −8 examples/SendingSample/settings.php
  52. +1 −0 phpunit.xml
  53. +82 −212 src/LINEBot.php
  54. +8 −3 src/LINEBot/{Exception/ContentsDownloadingFailedException.php → Constant/ActionType.php}
  55. +8 −6 src/LINEBot/{Response/Response.php → Constant/EventSourceType.php}
  56. +5 −4 src/LINEBot/Constant/{OpType.php → HTTPHeader.php}
  57. +12 −6 src/LINEBot/Constant/{EventType.php → MessageType.php}
  58. +5 −3 src/LINEBot/Constant/{RecipientType.php → Meta.php}
  59. +26 −0 src/LINEBot/Constant/TemplateType.php
  60. +153 −0 src/LINEBot/Event/BaseEvent.php
  61. +24 −24 src/LINEBot/{Response/FailedResponse.php → Event/BeaconDetectionEvent.php}
  62. +37 −0 src/LINEBot/Event/FollowEvent.php
  63. +37 −0 src/LINEBot/Event/JoinEvent.php
  64. +37 −0 src/LINEBot/Event/LeaveEvent.php
  65. +22 −25 src/LINEBot/{DownloadedContents.php → Event/MessageEvent.php}
  66. +39 −0 src/LINEBot/Event/MessageEvent/AudioMessage.php
  67. +39 −0 src/LINEBot/Event/MessageEvent/ImageMessage.php
  68. +79 −0 src/LINEBot/Event/MessageEvent/LocationMessage.php
  69. +59 −0 src/LINEBot/Event/MessageEvent/StickerMessage.php
  70. +25 −26 src/LINEBot/{Receive/Message/Image.php → Event/MessageEvent/TextMessage.php}
  71. +39 −0 src/LINEBot/Event/MessageEvent/VideoMessage.php
  72. +110 −0 src/LINEBot/Event/Parser/EventRequestParser.php
  73. +24 −11 src/LINEBot/{Response/ResponseFactory.php → Event/PostbackEvent.php}
  74. +37 −0 src/LINEBot/Event/UnfollowEvent.php
  75. +9 −2 src/LINEBot/Exception/{JSONDecodingException.php → CurlExecutionException.php}
  76. +28 −0 src/LINEBot/Exception/InvalidEventRequestException.php
  77. +9 −2 src/LINEBot/Exception/{JSONEncodingException.php → InvalidEventSourceException.php}
  78. +7 −1 src/LINEBot/Exception/InvalidSignatureException.php
  79. +9 −2 src/LINEBot/Exception/{IllegalRichMessageHeightException.php → UnknownEventTypeException.php}
  80. +28 −0 src/LINEBot/Exception/UnknownMessageTypeException.php
  81. +0 −21 src/LINEBot/Exception/UnsupportedContentTypeException.php
  82. +0 −21 src/LINEBot/Exception/UnsupportedEventTypeException.php
  83. +0 −21 src/LINEBot/Exception/UnsupportedOperationTypeException.php
  84. +18 −17 src/LINEBot/{HTTPClient → }/HTTPClient.php
  85. +97 −0 src/LINEBot/HTTPClient/Curl.php
  86. +115 −0 src/LINEBot/HTTPClient/CurlHTTPClient.php
  87. +0 −179 src/LINEBot/HTTPClient/GuzzleHTTPClient.php
  88. +16 −11 src/LINEBot/{Constant/ContentType.php → ImagemapActionBuilder.php}
  89. +67 −0 src/LINEBot/ImagemapActionBuilder/AreaBuilder.php
  90. +61 −0 src/LINEBot/ImagemapActionBuilder/ImagemapMessageActionBuilder.php
  91. +59 −0 src/LINEBot/ImagemapActionBuilder/ImagemapUriActionBuilder.php
  92. +0 −137 src/LINEBot/Message/Builder/MessageBuilder.php
  93. +0 −39 src/LINEBot/Message/Builder/MultipleMessagesBuilder.php
  94. +0 −46 src/LINEBot/Message/Builder/RichMessageBuilder.php
  95. +0 −120 src/LINEBot/Message/MultipleMessages.php
  96. +0 −152 src/LINEBot/Message/RichMessage/Markup.php
  97. +16 −6 src/LINEBot/{Constant/BotAPIChannel.php → MessageBuilder.php}
  98. +62 −0 src/LINEBot/MessageBuilder/AudioMessageBuilder.php
  99. +63 −0 src/LINEBot/MessageBuilder/ImageMessageBuilder.php
  100. +57 −0 src/LINEBot/MessageBuilder/Imagemap/BaseSizeBuilder.php
  101. +87 −0 src/LINEBot/MessageBuilder/ImagemapMessageBuilder.php
  102. +73 −0 src/LINEBot/MessageBuilder/LocationMessageBuilder.php
  103. +56 −0 src/LINEBot/MessageBuilder/MultiMessageBuilder.php
  104. +63 −0 src/LINEBot/MessageBuilder/StickerMessageBuilder.php
  105. +34 −0 src/LINEBot/MessageBuilder/TemplateBuilder.php
  106. +86 −0 src/LINEBot/MessageBuilder/TemplateBuilder/ButtonTemplateBuilder.php
  107. +84 −0 src/LINEBot/MessageBuilder/TemplateBuilder/CarouselColumnTemplateBuilder.php
  108. +70 −0 src/LINEBot/MessageBuilder/TemplateBuilder/CarouselTemplateBuilder.php
  109. +76 −0 src/LINEBot/MessageBuilder/TemplateBuilder/ConfirmTemplateBuilder.php
  110. +62 −0 src/LINEBot/MessageBuilder/TemplateMessageBuilder.php
  111. +67 −0 src/LINEBot/MessageBuilder/TextMessageBuilder.php
  112. +63 −0 src/LINEBot/MessageBuilder/VideoMessageBuilder.php
  113. +0 −88 src/LINEBot/Receive/Message.php
  114. +0 −50 src/LINEBot/Receive/Message/Audio.php
  115. +0 −63 src/LINEBot/Receive/Message/Contact.php
  116. +0 −78 src/LINEBot/Receive/Message/Location.php
  117. +0 −55 src/LINEBot/Receive/Message/MessageReceiveFactory.php
  118. +0 −73 src/LINEBot/Receive/Message/Sticker.php
  119. +0 −55 src/LINEBot/Receive/Message/Text.php
  120. +0 −50 src/LINEBot/Receive/Message/Video.php
  121. +0 −50 src/LINEBot/Receive/Operation/AddContact.php
  122. +0 −50 src/LINEBot/Receive/Operation/BlockContact.php
  123. +0 −44 src/LINEBot/Receive/Operation/OperationReceiveFactory.php
  124. +0 −64 src/LINEBot/Receive/Receive.php
  125. +0 −83 src/LINEBot/Receive/ReceiveFactory.php
  126. +84 −0 src/LINEBot/Response.php
  127. +0 −57 src/LINEBot/Response/SucceededResponse.php
  128. +17 −9 src/LINEBot/SignatureValidator.php
  129. +34 −0 src/LINEBot/TemplateActionBuilder.php
  130. +61 −0 src/LINEBot/TemplateActionBuilder/MessageTemplateActionBuilder.php
  131. +61 −0 src/LINEBot/TemplateActionBuilder/PostbackTemplateActionBuilder.php
  132. +61 −0 src/LINEBot/TemplateActionBuilder/UriTemplateActionBuilder.php
  133. +311 −0 tests/LINEBot/EventRequestParserTest.php
  134. +52 −0 tests/LINEBot/GetProfileTest.php
  135. +0 −81 tests/LINEBot/GettingContentsTest.php
  136. +0 −549 tests/LINEBot/MessageSendingTest.php
  137. +0 −165 tests/LINEBot/MultipleMessagesSendingTest.php
  138. +0 −108 tests/LINEBot/ReceiveFactoryTest.php
  139. +0 −179 tests/LINEBot/RichMessageSendingTest.php
  140. +79 −0 tests/LINEBot/SendAudioTest.php
  141. +79 −0 tests/LINEBot/SendImageTest.php
  142. +146 −0 tests/LINEBot/SendImagemapTest.php
  143. +83 −0 tests/LINEBot/SendLocationTest.php
  144. +88 −0 tests/LINEBot/SendMultiMessageTest.php
  145. +73 −0 tests/LINEBot/SendStickerTest.php
  146. +150 −0 tests/LINEBot/SendTemplateTest.php
  147. +152 −0 tests/LINEBot/SendTextTest.php
  148. +79 −0 tests/LINEBot/SendVideoTest.php
  149. +0 −110 tests/LINEBot/SignatureValidationTest.php
  150. +190 −0 tests/LINEBot/SignatureValidatorTest.php
  151. +57 −0 tests/LINEBot/Util/DummyHttpClient.php
  152. +0 −73 tests/LINEBotTest.php
  153. +4 −2 tests/bootstrap.php
View
@@ -1,7 +1,7 @@
/.idea/
/vendor/
/composer.lock
/composer.phar
composer.lock
composer.phar
/tests/Private
/,/
/docs/
*.iml
vendor/
View
@@ -1,13 +1,7 @@
language: php
matrix:
include:
- php: '5.4'
before_script: composer require 'indigophp/hash-compat:^1.1'
- php: '5.5'
before_script: composer require 'indigophp/hash-compat:^1.1'
- php: '5.6'
- php: '7.0'
php:
- '5.6'
- '7.0'
install: composer update
script: ./vendor/bin/phpunit ./tests
sudo: false
View
@@ -3,10 +3,10 @@
First of all, thank you so much for taking your time to contribute! LINE Bot SDK for PHP is not very different from any other open
source projects you are aware of. It will be amazing if you could help us by doing any of the following:
- File an issue in [the issue tracker](https://github.com/line/line-bot-sdk-php/issues) to report bugs and propose new features and
- File an issue in [the issue tracker](https://github.com/line/line-bot-sdk-php-v2/issues) to report bugs and propose new features and
improvements.
- Ask a question using [the issue tracker](https://github.com/line/line-bot-sdk-php/issues) (__Please ask only about this SDK__).
- Contribute your work by sending [a pull request](https://github.com/line/line-bot-sdk-php/pulls).
- Ask a question using [the issue tracker](https://github.com/line/line-bot-sdk-php-v2/issues) (__Please ask only about this SDK__).
- Contribute your work by sending [a pull request](https://github.com/line/line-bot-sdk-php-v2/pulls).
### Contributor license agreement
View
@@ -1,6 +1,6 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
https://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
@@ -192,7 +192,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
View
@@ -1,19 +1,28 @@
COMPOSER_BIN = ./vendor/bin
.PHONY: default test doc phpcs phpmd check
default: check
test:
$(COMPOSER_BIN)/phpunit ./tests
doc:
yes yes | $(COMPOSER_BIN)/apigen generate --source=./src --destination=./docs --title line-bot-sdk-php
phpcs:
$(COMPOSER_BIN)/phpcs --standard=PSR2 src/ examples/SendingSample/ examples/EchoBot/src examples/EchoBot/public
$(COMPOSER_BIN)/phpcs --standard=PSR2 src/ tests/ examples/EchoBot/src examples/EchoBot/public examples/KitchenSink/src examples/KitchenSink/public
phpmd:
$(COMPOSER_BIN)/phpmd ./src text cleancode,codesize,controversial,design,unusedcode,naming | grep -v 'Avoid using static access to class'
$(COMPOSER_BIN)/phpmd ./examples/SendingSample text cleancode,codesize,controversial,design,unusedcode,naming | grep -v 'Avoid using static access to class'
$(COMPOSER_BIN)/phpmd ./tests text cleancode,codesize,controversial,design,unusedcode,naming | grep -v 'Avoid using static access to class'
$(COMPOSER_BIN)/phpmd ./examples/EchoBot/src text cleancode,codesize,controversial,design,unusedcode,naming | grep -v 'Avoid using static access to class'
$(COMPOSER_BIN)/phpmd ./examples/EchoBot/public text cleancode,codesize,controversial,design,unusedcode,naming | grep -v 'Avoid using static access to class'
$(COMPOSER_BIN)/phpmd ./examples/KitchenSink/src text cleancode,codesize,controversial,design,unusedcode,naming | grep -v 'Avoid using static access to class'
$(COMPOSER_BIN)/phpmd ./examples/KitchenSink/public text cleancode,codesize,controversial,design,unusedcode,naming | grep -v 'Avoid using static access to class'
copyright:
bash ./devtool/check_copyright.sh
check: test phpcs phpmd
check: test copyright phpcs phpmd
Oops, something went wrong.

0 comments on commit e16d9ca

Please sign in to comment.