Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
6 | daniel-mar | 1 | #!/bin/bash |
2 | |||
3 | DIR=$( dirname "$0" ) |
||
4 | |||
5 | cd "$DIR" |
||
6 | |||
7 | # There are several PHP scripts which run in CLI and don't have file extensions |
||
8 | # To check them with PHPstan, we need to temporarily rename them using this script |
||
9 | |||
10 | array=( $( grep -r "#!" . | grep php | grep -v ".svn" | cut -d ':' -f 1 | sort | uniq ) ) |
||
11 | |||
12 | for ix in ${!array[*]} |
||
13 | do |
||
14 | file="${array[$ix]}" |
||
15 | mv "$file" "$file.php" |
||
16 | done |
||
17 | |||
18 | # TODO: Adjust to your path |
||
19 | php7 /root/phpstan.phar |
||
20 | |||
21 | for ix in ${!array[*]} |
||
22 | do |
||
23 | file="${array[$ix]}" |
||
24 | mv "$file.php" "$file" |
||
25 | done |