laravel-shift / cli

A tool to run automated tasks for maintaining your Laravel projects.
MIT License
58 stars 6 forks source link

Not working on WIndows 10 - Uncaught TypeError: trim() #5

Closed BrandonSurowiec closed 1 year ago

BrandonSurowiec commented 1 year ago

PHP 8.1.18 Windows 10

Running this or any command throws an exception:

shift-cli run class-strings

Stack Trace:

PHP Fatal error:  Uncaught TypeError: trim(): Argument #1 ($string) must be of type string, bool given in phar://C:/Users/13136/AppData/Roaming/Composer/vendor/laravel-shift/cli/builds/shift-cli/.box/src/Terminal.php:60
Stack trace:
#0 phar://C:/Users/13136/AppData/Roaming/Composer/vendor/laravel-shift/cli/builds/shift-cli/.box/src/Terminal.php(60): trim(false)
#1 phar://C:/Users/13136/AppData/Roaming/Composer/vendor/laravel-shift/cli/builds/shift-cli/.box/src/Terminal.php(31): HumbugBox436\KevinGH\RequirementChecker\Terminal::initDimensions()
#2 phar://C:/Users/13136/AppData/Roaming/Composer/vendor/laravel-shift/cli/builds/shift-cli/.box/src/Printer.php(28): HumbugBox436\KevinGH\RequirementChecker\Terminal->getWidth()
#3 phar://C:/Users/13136/AppData/Roaming/Composer/vendor/laravel-shift/cli/builds/shift-cli/.box/src/Checker.php(17): HumbugBox436\KevinGH\RequirementChecker\Printer->__construct(32, true)
#4 phar://C:/Users/13136/AppData/Roaming/Composer/vendor/laravel-shift/cli/builds/shift-cli/.box/bin/check-requirements.php(22): HumbugBox436\KevinGH\RequirementChecker\Checker::checkRequirements()
#5 C:\Users\13136\AppData\Roaming\Composer\vendor\laravel-shift\cli\builds\shift-cli(12): require('phar://C:/Users...')
#6 C:\Users\13136\AppData\Roaming\Composer\vendor\bin\shift-cli(124): include('C:\\Users\\13136\\...')
#7 {main}
  thrown in phar://C:/Users/13136/AppData/Roaming/Composer/vendor/laravel-shift/cli/builds/shift-cli/.box/src/Terminal.php on line 60
jasonmccreary commented 1 year ago

This seems to be related to Box, which is the bundler for the app PHAR.

I have tried the solution Pint did, and rebuilt v0.2.7. Run composer update and let me know if it resolves this issue.

BrandonSurowiec commented 1 year ago

Can confirm it is fixed. Thanks!

relaypilot commented 1 year ago

Same issue is happening with CLI premium:

"laravel-shift/cli-premium": "^0.2.5",

Edit: should be resolved now: https://github.com/laravel-shift/cli/issues/6#issuecomment-1737617483