Require using identical comparison operators

This commit is contained in:
Zach Borboa
2016-02-05 19:43:37 -08:00
parent 98c9d8fa25
commit c85e0a0048
+7
View File
@@ -84,3 +84,10 @@ if [[ ! -z "${caps}" ]]; then
echo -e "${caps}" | perl -pe 's/^(.*)$/All caps found in \1/'
exit 1
fi
# Require identical comparison operators (===, not ==) in php files.
equal=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec egrep --color=always --line-number -H "[^!=]==[^=]" {} \;)
if [[ ! -z "${equal}" ]]; then
echo -e "${equal}" | perl -pe 's/^(.*)$/Non-identical comparison operator found in \1/'
exit 1
fi