php-library-starter-kit icon indicating copy to clipboard operation
php-library-starter-kit copied to clipboard

Error with Windows and Symfony/Process 2.8.52

Open ncou opened this issue 3 years ago • 2 comments

Hi,

Nice piece of code. I have the same error as described here (https://github.com/ramsey/php-library-starter-kit/issues/32). It's an array to string conversion error.

I use composer v2.2.3 and the symfony/process version bundled with is the version 2.8.52. In the log there and error line 263 (https://github.com/symfony/process/blob/v2.8.52/Process.php#L263). This happen only in windows OS.

After looking at your code there is an error here : https://github.com/ramsey/php-library-starter-kit/blob/449428b38f9fec175962ab8fafbbfc2ac105bb40/src/LibraryStarterKit/Setup.php#L135

You look if the first parameter in the constructor has a typehint as "array" and if it's not the case you convert the array to string. In the v2.8.52 of the Process class there is no typehint so the command is left as an array and you will have the error line 263 of the process.

You should check if there is a typehint as array for the first parameter you don't convert it as a string ELSE you convert it as string. Same logic as used here : https://github.com/ramsey/devtools-lib/blob/ea4205cc4fb3b68126977deff59742ede8105c90/src/Process/Process.php#L71

I hope i am clear enough.

Keep up the good work.

ncou avatar Feb 26 '22 10:02 ncou

Hi,

Nice piece of code. I have the same error as described here (#32). It's an array to string conversion error.

I use composer v2.2.3 and the symfony/process version bundled with is the version 2.8.52. In the log there and error line 263 (https://github.com/symfony/process/blob/v2.8.52/Process.php#L263). This happen only in windows OS.

After looking at your code there is an error here :

https://github.com/ramsey/php-library-starter-kit/blob/449428b38f9fec175962ab8fafbbfc2ac105bb40/src/LibraryStarterKit/Setup.php#L135

You look if the first parameter in the constructor has a typehint as "array" and if it's not the case you convert the array to string. In the v2.8.52 of the Process class there is no typehint so the command is left as an array and you will have the error line 263 of the process.

You should check if there is a typehint as array for the first parameter you don't convert it as a string ELSE you convert it as string. Same logic as used here : https://github.com/ramsey/devtools-lib/blob/ea4205cc4fb3b68126977deff59742ede8105c90/src/Process/Process.php#L71

I hope i am clear enough.

Keep up the good work.

Hi I have the same issue on Linux Mint and PHP 8.0 The kit works perfectly until the Fixing style issues process. I get this problem: image.

gam04 avatar Mar 20 '22 02:03 gam04

Hi, It's not really the same error, i think you have bump you Composer version to the v2.3-RC1 and there is a lot of breaking change in this version.

Can you confirm wich version of Composer you are using ? (type "Composer --version" to get this information).

ncou avatar Mar 20 '22 10:03 ncou

The latest version of the starter kit (3.5) raises the minimum version of Composer to 2.5, which fixes this issue.

ramsey avatar Apr 27 '23 02:04 ramsey