File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,19 +26,18 @@ phpcs_command="php $phpcs_local_exec"
2626# Check vendor/bin/phpunit
2727phpcs_vendor_command=" vendor/bin/phpcs"
2828phpcs_global_command=" phpcs"
29+
2930if [ -f " $phpcs_vendor_command " ]; then
30- phpcs_command=$phpcs_vendor_command
31+ phpcs_command=$phpcs_vendor_command
32+ elif type -P ' phpcs' ; then
33+ phpcs_command=' phpcs'
34+ elif type -P ' phpcs.phar' ; then
35+ phpcs_command=' phpcs.phar'
36+ elif [ -f " $phpcs_local_exec " ]; then
37+ phpcs_command=$phpcs_command
3138else
32- if hash phpcs 2> /dev/null; then
33- phpcs_command=$phpcs_global_command
34- else
35- if [ -f " $phpcs_local_exec " ]; then
36- phpcs_command=$phpcs_command
37- else
38- echo " No valid PHP Codesniffer executable found! Please have one available as either $phpcs_vendor_command , $phpcs_global_command or $phpcs_local_exec "
39- exit 1
40- fi
41- fi
39+ echo " No valid PHP Codesniffer executable found! Please have one available as either $phpcs_vendor_command , $phpcs_global_command or $phpcs_local_exec "
40+ exit 1
4241fi
4342
4443phpcs_files_to_check=" ${@: 2} "
5756 exit 1
5857fi
5958
60- exit 0
59+ exit 0
You can’t perform that action at this time.
0 commit comments