Skip to content

Commit c884132

Browse files
authored
Fix EchoBot DI error to receive messages (#676)
Resolve #675 I referred to KitchenSink. https://github.com/line/line-bot-sdk-php/blob/2135b059c6e99c4e551ad3de1097e21ea1ec6f2e/examples/KitchenSink/src/LINEBot/KitchenSink/Dependency.php#L42 https://github.com/line/line-bot-sdk-php/blob/2135b059c6e99c4e551ad3de1097e21ea1ec6f2e/examples/KitchenSink/composer.json#L20-L40 I have fixed the correction of DI name (botMessagingApi -> MessagingApiApi::class) was missed in the past revisions. In addition, classes in line-bot-sdk-php was used directly so I have fixed to be used via composer and we can use some classes like Configuration class.
1 parent cef9479 commit c884132

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

examples/EchoBot/composer.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@
1717
"role": "Maintainer"
1818
}
1919
],
20+
"repositories": [
21+
{
22+
"type": "path",
23+
"url": "../../",
24+
"options": {
25+
"symlink": false
26+
}
27+
}
28+
],
2029
"require": {
2130
"php": ">=8.1",
2231
"slim/slim": "^4.11",
@@ -25,8 +34,10 @@
2534
"monolog/monolog": "^3.0.0",
2635
"guzzlehttp/guzzle": "^7.5",
2736
"guzzlehttp/psr7": "^2.5",
28-
"php-di/slim-bridge": "^3.3"
37+
"php-di/slim-bridge": "^3.3",
38+
"linecorp/line-bot-sdk": "*"
2939
},
40+
"minimum-stability": "dev",
3041
"autoload": {
3142
"psr-4": {
3243
"LINE\\": "src/"

examples/EchoBot/src/LINEBot/EchoBot/Dependency.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function register(\DI\Container $container)
3838
return $logger;
3939
});
4040

41-
$container->set('botMessagingApi', function ($c) {
41+
$container->set(MessagingApiApi::class, function ($c) {
4242
$settings = $c->get('settings');
4343
$channelToken = $settings['bot']['channelToken'];
4444
$config = new Configuration();

0 commit comments

Comments
 (0)