ansi-php icon indicating copy to clipboard operation
ansi-php copied to clipboard

[fix] PhpStorm error: Return value is expected to be '\Bramus\Ansi\Ansi', '\Bramus\Ansi\Traits\Ansi' returned

Open taka-oyama opened this issue 2 years ago • 0 comments

Hi, thanks for the great library.

PhpStorm couldn't resolve the return type for methods in Bramus\Ansi\Traits\ControlFunctions so I made a small fix.

Example code that shows the error:

    public function line(string $text): \Bramus\Ansi\Ansi
    {
        return $this->text($text)->lf();
    }

This should also fix https://github.com/bramus/ansi-php/issues/10.

taka-oyama avatar Sep 08 '22 22:09 taka-oyama