Showing 6 of 6 total issues
Method resolveMessageListener
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function resolveMessageListener(string $signature): string
{
$subHandlerSignature = Str::after($signature, 'message.');
$subHandlerName = explode('.', $subHandlerSignature)[0] ?? null;
Method register
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function register()
{
$this->telegramRoutes = $this->app->basePath('routes/telegram.php');
$this->mergeConfigFrom(self::CONFIG_PATH, 'nutgram');
Method handle
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function handle(Nutgram $bot): int
{
$webhookInfo = $bot->getWebhookInfo();
if ($webhookInfo === null) {
Method boot
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function boot(): void
{
$this->loadViewsFrom(__DIR__.'/../resources/views/logging', 'logging');
if ($this->app->runningInConsole()) {
Method resolveUpdateListener
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function resolveUpdateListener(string $signature): string
{
return match (Str::before($signature, '.')) {
'message' => $this->resolveMessageListener($signature),
'edited_message' => 'onEditedMessage',
Avoid too many return
statements within this method. Open
Open
return 'unknown';