bramus / bramus/ansi-php

`->reset()->lf()` and `->lf()->reset()` are not interchangable

Open
#10 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
96
Forks
10
PR merge metrics
No merged PRs in 30d

Description

it seems there is a difference between these 2 calls:

`$ansi->color(SGR::COLOR_FG_RED)->text($text)->reset()->lf();`

`$ansi->color(SGR::COLOR_FG_RED)->text($text)->lf()->reset();`

phpstorm and phpstan tell me that the 2nd example is an error. from a user point of view, I feel these should be the same thing

Contributor guide

No contributing guide indexed for this repository

Research direction

No file or test is named. Start by reproducing both chaining examples with the ANSI color, text, reset, and line-feed calls, then trace the implementations of reset() and lf() to compare their output and return types. Done means the two call orders behave equivalently from a user perspective, with the reported PhpStorm and PHPStan error addressed if it reflects the library.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.