mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-10-09 05:25:31 +00:00
Fix #254: CaseInsensitiveArray not found.
This commit is contained in:
+7
-7
@@ -1,21 +1,21 @@
|
||||
# Check syntax in php files.
|
||||
find . -type "f" -iname "*.php" -exec php -l {} \;
|
||||
find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec php -l {} \;
|
||||
|
||||
# Run tests.
|
||||
cd tests && phpunit --configuration phpunit.xml
|
||||
phpunit --configuration tests/phpunit.xml
|
||||
if [[ "${?}" -ne 0 ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Enforce line ending consistency in php files.
|
||||
crlf_file=$(find . -type "f" -iname "*.php" -exec grep --files-with-matches $'\r' {} \;)
|
||||
crlf_file=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec grep --files-with-matches $'\r' {} \;)
|
||||
if [[ ! -z "${crlf_file}" ]]; then
|
||||
echo "${crlf_file}" | perl -pe 's/(.*)/CRLF line terminators found in \1/'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Enforce indentation character consistency in php files.
|
||||
tab_char=$(find . -type "f" -iname "*.php" -exec grep --line-number -H --perl-regexp "\t" {} \;)
|
||||
tab_char=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec grep --line-number -H --perl-regexp "\t" {} \;)
|
||||
if [[ ! -z "${tab_char}" ]]; then
|
||||
echo -e "${tab_char}" | perl -pe 's/^(.*)$/Tab character found in \1/'
|
||||
exit 1
|
||||
@@ -50,7 +50,7 @@ EOF
|
||||
# Skip hhvm "Notice: File could not be loaded: ..."
|
||||
if [[ "${TRAVIS_PHP_VERSION}" != "hhvm" ]]; then
|
||||
export -f "find_invalid_indentation"
|
||||
invalid_indentation=$(find . -type "f" -iname "*.php" -exec bash -c 'find_invalid_indentation "{}"' \;)
|
||||
invalid_indentation=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec bash -c 'find_invalid_indentation "{}"' \;)
|
||||
if [[ ! -z "${invalid_indentation}" ]]; then
|
||||
echo "${invalid_indentation}"
|
||||
exit 1
|
||||
@@ -58,14 +58,14 @@ if [[ "${TRAVIS_PHP_VERSION}" != "hhvm" ]]; then
|
||||
fi
|
||||
|
||||
# Prohibit trailing whitespace in php files.
|
||||
trailing_whitespace=$(find . -type "f" -iname "*.php" -exec egrep --line-number -H " +$" {} \;)
|
||||
trailing_whitespace=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec egrep --line-number -H " +$" {} \;)
|
||||
if [[ ! -z "${trailing_whitespace}" ]]; then
|
||||
echo -e "${trailing_whitespace}" | perl -pe 's/^(.*)$/Trailing whitespace found in \1/'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Prohibit long lines in php files.
|
||||
long_lines=$(find . -type "f" -iname "*.php" -exec awk '{print FILENAME":"NR" "length}' {} \; | awk '$2 > 120')
|
||||
long_lines=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec awk '{print FILENAME":"NR" "length}' {} \; | awk '$2 > 120')
|
||||
if [[ ! -z "${long_lines}" ]]; then
|
||||
echo -e "${long_lines}" | perl -pe 's/^(.*)$/Long lines found in \1/'
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user