-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ddc8c9
commit 8b90f63
Showing
7 changed files
with
76 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
## Description: Run PHP_CodeSniffer's code beautifier | ||
## Usage: phpcbf [flags] [args] | ||
## Example: "ddev phpcbf --standard=core/phpcs.xml.dist index.php" or "ddev phpcbf index.php" | ||
## HostWorkingDir: true | ||
## ExecRaw: true | ||
|
||
if ! command -v phpcbf >/dev/null; then | ||
echo "phpcbf is not available. You may need to 'ddev composer require squizlabs/php_codesniffer'" | ||
exit 1 | ||
fi | ||
phpcbf "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
## Description: Run PHP_CodeSniffer's codesniffer | ||
## Usage: phpcs [flags] [args] | ||
## Example: "ddev phpcs --standard=core/phpcs.xml.dist index.php" or "ddev phpcs index.php" | ||
## HostWorkingDir: true | ||
## ExecRaw: true | ||
|
||
if ! command -v phpcs >/dev/null; then | ||
echo "phpcs is not available. You may need to 'ddev composer require squizlabs/php_codesniffer'" | ||
exit 1 | ||
fi | ||
phpcs "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
>&2 echo "Notice: running 'phpcbf $*' in ddev" | ||
|
||
if [ -n "${GITPOD_REPO_ROOT:-}" ]; then | ||
# Replace all references to the absolute paths to the repo root. | ||
# This will ensure IDEs like PHPStorm can pass files into it without issue. | ||
arguments=() | ||
for arg in "$@"; do | ||
new_arg="${arg//${GITPOD_REPO_ROOT}//var/www/html}" | ||
arguments+=("$new_arg") | ||
done | ||
else | ||
arguments=("$@") | ||
fi | ||
|
||
ddev exec_d phpcbf "${arguments[@]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
>&2 echo "Notice: running 'phpcs $*' in ddev" | ||
|
||
if [ -n "${GITPOD_REPO_ROOT:-}" ]; then | ||
# Replace all references to the absolute paths to the repo root. | ||
# This will ensure IDEs like PHPStorm can pass files into it without issue. | ||
arguments=() | ||
for arg in "$@"; do | ||
new_arg="${arg//${GITPOD_REPO_ROOT}//var/www/html}" | ||
arguments+=("$new_arg") | ||
done | ||
else | ||
arguments=("$@") | ||
fi | ||
|
||
ddev exec_d phpcs "${arguments[@]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
>&2 echo "Notice: running 'phpunit $*' in ddev" | ||
ddev exec_d phpunit "$@" |