Skip to content

erin-bristow/simple-php-validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

simple-php-validator

Bash script that executes the PHP command line option --syntax-check on all files in a directory and subdirectories. No need to exclude non-PHP files - the script takes care of that.

Also automatically excludes the third-party /vendor directory that contains composer dependencies for PHP projects. In a previous commit, there was a way to exclude directories via a flag like $ ./validate-php.sh -e /vendor -e /other-directory but it was buggy so decided to just explicitly exclude the vendor directory.

How to Use

Verify that your current shell is using bash.

$ ps -p $$
    PID TTY          TIME CMD
   6101 pts/1    00:00:00 bash

Give the .sh program permission to execute.

$ chmod +x validate-php.sh

Run the script! Note - it may take a few minutes to run, and may get temporarily stuck on certain syntax errors (not entirely sure why, maybe some types of errors take longer to analyze?).

$ ./validate-php.sh

About

Recurses over subdirectories to validate syntax of PHP files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages