generated from ddev/ddev-addon-template
-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathphpstan
executable file
·20 lines (18 loc) · 902 Bytes
/
phpstan
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env bash
#ddev-generated
## Command provided by https://github.com/ddev/ddev-drupal-contrib
## Description: Run phpstan inside the web container
## Usage: phpstan [flags] [args]
## Example: "ddev phpstan" or "ddev phpstan -n"
## ExecRaw: true
DRUPAL_PROJECTS_PATH=${DRUPAL_PROJECTS_PATH:-modules/custom}
if ! command -v phpstan >/dev/null; then
echo "phpstan is not available. You may need to 'ddev poser'"
exit 1
fi
test -e phpstan.neon || curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/assets/phpstan.neon
# See https://git.drupalcode.org/project/gitlab_templates/-/commit/a107b7f1f79af12e0b09f70be47b68e3f69b4504
sed -i 's/BASELINE_PLACEHOLDER/phpstan-baseline.neon/g' phpstan.neon
# Add an empty baseline file to ensure it exists.
test -e phpstan-baseline.neon || touch phpstan-baseline.neon
phpstan analyse $DDEV_DOCROOT/$DRUPAL_PROJECTS_PATH "$@"