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

Requirement checker fails in Git Bash #990

Closed
wants to merge 1 commit into from

Conversation

danepowell
Copy link
Contributor

@danepowell danepowell commented Apr 24, 2023

If you attempt to run a compiled project in Git Bash (Windows 11), you'll get an error from the requirements checker:

trim(): Argument #1 ($string) must be of type string, bool given in acli.phar/.box/src/Terminal.php:60

I understand this code is copied from Symfony Console, which means this bug likely exists upstream as well: symfony/symfony#50143

chalasr added a commit to symfony/symfony that referenced this pull request Apr 25, 2023
…ool given (danepowell)

This PR was merged into the 5.4 branch.

Discussion
----------

[Console] trim(): Argument #1 () must be of type string, bool given

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  |no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? |no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->
<!--
Replace this notice by a short README for your feature/bugfix.
This will help reviewers and should be a good start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too).
 - Features and deprecations must be submitted against the latest branch.
 - For new features, provide some code snippets to help understand usage.
 - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
 - Never break backward compatibility (see https://symfony.com/bc).
-->

If you run a Symfony Console application in Git Bash, ANSICON is not set out of the box and results in this (suppressed) error:
> trim(): Argument ($string) must be of type string, bool given

AFAICT, this method is only called from Application::run() and errors are suppressed. So users will never actually see that error. Still, it could have side effects and breaks downstream projects: box-project/box#990

Commits
-------

324b160 trim(): Argument #1 () must be of type string, bool given
Copy link
Member

@theofidry theofidry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice finding :o !

@danepowell
Copy link
Contributor Author

Thanks! Symfony merged the fix upstream. Let me know if you need anything else.

@danepowell
Copy link
Contributor Author

@theofidry any chance you could merge this and cut a new release? We continue to get complaints from users encountering this bug.

@nunomaduro
Copy link

@theofidry Hi buddy, any chance getting this merged and tagged? Let me know if I can help on anything.

@theofidry
Copy link
Member

Merged via #999

@theofidry theofidry closed this Oct 6, 2023
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.

3 participants