Skip to content

Fix PHPDoc references. - #7

Merged
bramus merged 1 commit into
bramus:masterfrom
AlexHowansky:master
Oct 21, 2021
Merged

bramus merged 1 commit into
bramus:masterfrom
AlexHowansky:master

Conversation

@AlexHowansky

Copy link
Copy Markdown
Contributor

Hello, here is a patch to fix some simple errors in PHP docblocks that lead to problems with PHPStan and IDE autocompletion.

Given the following code:

use Bramus\Ansi\Ansi;
use Bramus\Ansi\Writers\BufferWriter;
use Bramus\Ansi\ControlSequences\EscapeSequences\Enums\SGR;

$ansi = new Ansi(new BufferWriter());
$ansi->color([SGR::COLOR_FG_WHITE])->get();

Running PHPStan on this code will yield the following errors:

1) Parameter #1 $writer of class Bramus\Ansi\Ansi constructor expects
    Bramus\Ansi\Writer\WriterInterface|null,
    Bramus\Ansi\Writers\BufferWriter given.

2) Call to method get() on an unknown class Bramus\Ansi\Traits\EscapeSequences\Ansi.

The first issue is just a typo, Writer versus Writers in a number of docblock attributes in Ansi.php.

The second issue is a result of the traits using @return Ansi but Ansi is not in the same namespace as the trait. This was fixed simply by adding the appropriate use statement.

All tests passing, no functionality added or changed.

@bramus
bramus merged commit 9aefed0 into bramus:master Oct 21, 2021
@bramus

bramus commented Oct 21, 2021

Copy link
Copy Markdown
Owner

Thanks!

@bramus

bramus commented Oct 21, 2021

Copy link
Copy Markdown
Owner

New release tagged: 3.0.4

@AlexHowansky

Copy link
Copy Markdown
Contributor Author

Looks good, thank you!

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

Successfully merging this pull request may close these issues.

2 participants