File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,14 @@ find . -type "f" -iname "*.php" | xargs -L "1" php -l
4
4
# Run tests.
5
5
cd tests && phpunit --configuration phpunit.xml
6
6
7
- # Prohibit tab characters in php files.
7
+ # Enforce line ending consistency in php files.
8
+ crlf_file=$( find . -type " f" -iname " *.php" -exec grep --files-with-matches $' \r ' {} \; )
9
+ if [[ ! -z " ${crlf_file} " ]]; then
10
+ echo " ${crlf_file} " | perl -pe ' s/(.*)/CRLF line terminators found in \1/'
11
+ exit 1
12
+ fi
13
+
14
+ # Enforce indentation character consistency in php files.
8
15
tab_char=$( find . -type " f" -iname " *.php" -exec grep --line-number -H --perl-regexp " \t" {} \; )
9
16
if [[ ! -z " ${tab_char} " ]]; then
10
17
echo -e " ${tab_char} " | perl -pe ' s/^(.*)$/Tab character found in \1/'
You can’t perform that action at this time.
0 commit comments