Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docblock error #21

Closed
Versud opened this issue Jul 13, 2021 · 2 comments
Closed

docblock error #21

Versud opened this issue Jul 13, 2021 · 2 comments

Comments

@Versud
Copy link

Versud commented Jul 13, 2021

    WeStacks\TeleBot\BotManager

    ....

   /**
     * Get bot by name.
     * @param string $name bot name
     * @throws TeleBotObjectException
     * @return null|TeleBot
     */
    public function bot(string $name = null)
    {
        $bot = $name ?? $this->default ?? null;

        if (is_null($bot)) {
            throw TeleBotObjectException::defaultBotIsNotSet();
        }

        if (!isset($this->bots[$bot])) {
            throw TeleBotObjectException::botNotFound($bot);
        }

        if (!($this->bots[$bot] instanceof TeleBot)) {
            $this->bots[$bot] = new TeleBot($this->bots[$bot]);
        }

        return $this->bots[$bot];
    }

hello, how can this method return null?

@punyflash
Copy link
Member

Hello! It can't return null, you are right.
I'll fix this on some bigger update or let someone make pull request as this issue is not even breaking autocompletion for IDEs.

@Versud Versud closed this as completed Jul 13, 2021
@punyflash
Copy link
Member

Fixed in 35dad59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants