Subversion Repositories vgwhois

Rev

Rev 76 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  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. phpstan
  21.  
  22. for ix in ${!array[*]}
  23. do
  24.         file="${array[$ix]}"
  25.         mv "$file.php" "$file"
  26. done
  27.