Skip to content

Commit c85e0a0

Browse files
committed
Require using identical comparison operators
1 parent 98c9d8f commit c85e0a0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/script.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,10 @@ if [[ ! -z "${caps}" ]]; then
8484
echo -e "${caps}" | perl -pe 's/^(.*)$/All caps found in \1/'
8585
exit 1
8686
fi
87+
88+
# Require identical comparison operators (===, not ==) in php files.
89+
equal=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec egrep --color=always --line-number -H "[^!=]==[^=]" {} \;)
90+
if [[ ! -z "${equal}" ]]; then
91+
echo -e "${equal}" | perl -pe 's/^(.*)$/Non-identical comparison operator found in \1/'
92+
exit 1
93+
fi

0 commit comments

Comments
 (0)