Larastan: Does not work on Windows

Created on 2 Jul 2018  路  13Comments  路  Source: nunomaduro/larastan

'.' is not recognized as an internal or external command, operable program or batch file.

Looks like it's to do with Console\CodeAnalyseCommand line 42.

bug

All 13 comments

@jameslkingsley Can you please do a composer update nunomaduro/laravel-code-analyse and test again?

Thanks for feedback/help. But for information you shouldn't use this on production or real case scenarios. The package is still in development. 馃憤

I did that, and it solved the issue. However I am now getting this printed out in the console:

dir=$(cd "${0%[/\\]*}" > /dev/null; cd "../phpstan/phpstan/bin" && pwd)

if [ -d /proc/cygdrive ] && [[ $(which php) == $(readlink -n /proc/cygdrive)/* ]]; then
   # We are in Cgywin using Windows php, so the path must be translated
   dir=$(cygpath -m "$dir");
fi

"${dir}/phpstan" "$@"

@jameslkingsley Ok. I need to take a deeper look on this. Thanks.

Removing php from php phpstan here does the trick for me (so the line would be just 'phpstan',).

Not sure how it would impact other platforms though.

@ChristopheB @jameslkingsley Can you test now? Just used the solution that exists on laravel.

Same error as before:

dir=$(cd "${0%[/\\]*}" > /dev/null; cd "../phpstan/phpstan/bin" && pwd)

if [ -d /proc/cygdrive ] && [[ $(which php) == $(readlink -n /proc/cygdrive)/* ]]; then
   # We are in Cgywin using Windows php, so the path must be translated
   dir=$(cygpath -m "$dir");
fi

"${dir}/phpstan" "$@"

@jameslkingsley Have you made composer update nunomaduro/laravel-code-analyse?

I confirm that it does not work using the full path from Artisan::phpBinary().

Please note that there are some special .bat files for Windows in vendor/bin, which can be used directly, so maybe there is no need to prefix the command with php at all.

I did @nunomaduro

@jameslkingsley @ChristopheB How about now? Just made the solution you both proposed.

It works thanks! :ok_hand:

Works for me too!

Just to say, I use Laragon (I dropped Homestead and VMs).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Gummibeer picture Gummibeer  路  3Comments

lasselehtinen picture lasselehtinen  路  3Comments

szepeviktor picture szepeviktor  路  4Comments

bogdankharchenko picture bogdankharchenko  路  4Comments

spaceemotion picture spaceemotion  路  4Comments