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

OutputFormatterStyleStack error after upgrade from 1.4.6 to 1.4.7 on narrow console window #6727

Closed
janedbal opened this issue Mar 3, 2022 · 5 comments

Comments

@janedbal
Copy link
Contributor

janedbal commented Mar 3, 2022

Bug report

I'm getting this error during the output of errors.

In OutputFormatterStyleStack.php line 65:
                                                                                     
  [_PHPStan_9dde7d81b\Symfony\Component\Console\Exception\InvalidArgumentException]  
  Incorrectly nested style tag found.                                                
                                                                                     
Exception trace:
  at phar:///builds/ShipMonk/shipmonk/backend/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php:65
 _PHPStan_9dde7d81b\Symfony\Component\Console\Formatter\OutputFormatterStyleStack->pop() at phar:///builds/ShipMonk/shipmonk/backend/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Formatter/OutputFormatter.php:153
 _PHPStan_9dde7d81b\Symfony\Component\Console\Formatter\OutputFormatter->formatAndWrap() at phar:///builds/ShipMonk/shipmonk/backend/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Formatter/OutputFormatter.php:117
 _PHPStan_9dde7d81b\Symfony\Component\Console\Formatter\OutputFormatter->format() at phar:///builds/ShipMonk/shipmonk/backend/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Output/Output.php:[138](https://gitlab.com/ShipMonk/shipmonk/-/jobs/2158236810#L138)
 _PHPStan_9dde7d81b\Symfony\Component\Console\Output\Output->write() at phar:///builds/ShipMonk/shipmonk/backend/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Output/Output.php:118
 _PHPStan_9dde7d81b\Symfony\Component\Console\Output\Output->writeln() at phar:///builds/ShipMonk/shipmonk/backend/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Helper/Table.php:434
 _PHPStan_9dde7d81b\Symfony\Component\Console\Helper\Table->renderRow() at phar:///builds/ShipMonk/shipmonk/backend/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Helper/Table.php:351
 _PHPStan_9dde7d81b\Symfony\Component\Console\Helper\Table->render() at phar:///builds/ShipMonk/shipmonk/backend/vendor/phpstan/phpstan/phpstan.phar/src/Command/ErrorsConsoleStyle.php:73
 PHPStan\Command\ErrorsConsoleStyle->table() at phar:///builds/ShipMonk/shipmonk/backend/vendor/phpstan/phpstan/phpstan.phar/src/Command/Symfony/SymfonyStyle.php:59
 PHPStan\Command\Symfony\SymfonyStyle->table() at phar:///builds/ShipMonk/shipmonk/backend/vendor/phpstan/phpstan/phpstan.phar/src/Command/ErrorFormatter/TableErrorFormatter.php:80
 PHPStan\Command\ErrorFormatter\TableErrorFormatter->formatErrors() at phar:///builds/ShipMonk/shipmonk/backend/vendor/phpstan/phpstan/phpstan.phar/src/Command/AnalyseCommand.php:297
 PHPStan\Command\AnalyseCommand->execute() at phar:///builds/ShipMonk/shipmonk/backend/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Command/Command.php:259
 _PHPStan_9dde7d81b\Symfony\Component\Console\Command\Command->run() at phar:///builds/ShipMonk/shipmonk/backend/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Application.php:856
 _PHPStan_9dde7d81b\Symfony\Component\Console\Application->doRunCommand() at phar:///builds/ShipMonk/shipmonk/backend/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Application.php:259
 _PHPStan_9dde7d81b\Symfony\Component\Console\Application->doRun() at phar:///builds/ShipMonk/shipmonk/backend/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Application.php:157
 _PHPStan_9dde7d81b\Symfony\Component\Console\Application->run() at phar:///builds/ShipMonk/shipmonk/backend/vendor/phpstan/phpstan/phpstan.phar/bin/phpstan:94
 _PHPStan_9dde7d81b\{closure}() at phar:///builds/ShipMonk/shipmonk/backend/vendor/phpstan/phpstan/phpstan.phar/bin/phpstan:95
 require() at /builds/ShipMonk/shipmonk/backend/vendor/phpstan/phpstan/phpstan:8

Code snippet that reproduces the problem

Code analysis with narrow console open. It works when my console is fullscreen. First I noticed this in GitLab CI. Not sure it is related, but one error was printed fine, but second error on trait (longer header) failed.

Expected output

No error

@mergeable
Copy link

mergeable bot commented Mar 3, 2022

This bug report is missing a link to reproduction on phpstan.org.

It will most likely be closed after manual review.

@benjaminmal
Copy link

benjaminmal commented Mar 3, 2022

I am getting the same problem in github action CI on PHP 8.0.16 & 8.1.3. Can't find a way to reproduce in my local environment.

Run vendor/bin/phpstan analyse --configuration=phpstan-ci.neon --error-format=github --no-progress --no-interaction --ansi
  vendor/bin/phpstan analyse --configuration=phpstan-ci.neon --error-format=github --no-progress --no-interaction --ansi
  shell: /usr/bin/bash -e {0}
  env:
    APP_ENV: test
    COMPOSER_PROCESS_TIMEOUT: 0
    COMPOSER_NO_INTERACTION: 1
 ------ ----------------------------------------------------------------------- 
  Line   src/MyTrait.php (in context of class             
 ------ ----------------------------------------------------------------------- 

                                       
  Incorrectly nested style tag found.  
                                       

analyse [-c|--configuration CONFIGURATION] [-l|--level LEVEL] [--no-progress] [--debug] [-a|--autoload-file AUTOLOAD-FILE] [--error-format ERROR-FORMAT] [-b|--generate-baseline [GENERATE-BASELINE]] [--allow-empty-baseline] [--memory-limit MEMORY-LIMIT] [--xdebug] [--fix] [--watch] [--pro] [--] [<paths>...]

Error: Process completed with exit code 1.

Resolving PHPStan errors remove this error.

@ondrejmirtes
Copy link
Member

I managed to reproduce it and fix it: phpstan/phpstan-src@d921d06

@janedbal
Copy link
Contributor Author

janedbal commented Mar 8, 2022

Thank you!

@github-actions
Copy link

github-actions bot commented Apr 9, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants