for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Http;
use Longman\TelegramBot\Entities\Update;
use Longman\TelegramBot\Telegram;
class Kernel
{
* The application implementation.
* @var \Longman\TelegramBot\Telegram
protected $app;
* Create a new HTTP kernel instance.
* @param \Longman\TelegramBot\Telegram $app
* @return void
@return
Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.
Please refer to the PHP core documentation on constructors.
public function __construct(Telegram $app)
$this->app = $app;
}
* Handle an incoming HTTP request.
* @param \Longman\TelegramBot\Request2 $request
* @return \Longman\TelegramBot\Response
* @throws \Longman\TelegramBot\Exception\TelegramException
public function handle(Request $request)
$params = $request->json();
$update = new Update($params->all(), $this->app->getBotUsername());
if ($response = $this->app->processUpdate($update)) {
return $response->isOk();
return $response;
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.