Skip to content

Commit 8d41df1

Browse files
add a alias for running PHPStan with baseline
1 parent 3b4eb45 commit 8d41df1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

bin/sail

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ function display_help {
9696
echo " ${GREEN}sail phpunit ...${NC} Run PHPUnit"
9797
echo " ${GREEN}sail pest ...${NC} Run Pest"
9898
echo " ${GREEN}sail pint ...${NC} Run Pint"
99+
echo " ${GREEN}sail phpstan ...${NC} Run Phpstan"
99100
echo " ${GREEN}sail dusk${NC} Run the Dusk tests (Requires the laravel/dusk package)"
100101
echo " ${GREEN}sail dusk:fails${NC} Re-run previously failed Dusk tests (Requires the laravel/dusk package)"
101102
echo
@@ -345,6 +346,18 @@ elif [ "$1" == "pint" ]; then
345346
sail_is_not_running
346347
fi
347348

349+
# Proxy the "PHPStan" command to "php vendor/bin/phpstan analyse --generate-baseline"...
350+
elif [ "$1" == "phpstan" ]; then
351+
shift 1
352+
353+
if [ "$EXEC" == "yes" ]; then
354+
ARGS+=(exec -u "$APP_USER")
355+
[ ! -t 0 ] && ARGS+=(-T)
356+
ARGS+=("$APP_SERVICE" php vendor/bin/phpstan analyse --generate-baseline)
357+
else
358+
sail_is_not_running
359+
fi
360+
348361
# Proxy the "dusk" command to the "php artisan dusk" Artisan command...
349362
elif [ "$1" == "dusk" ]; then
350363
shift 1

0 commit comments

Comments
 (0)