mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-31 12:43:14 +00:00
Replace usage of is_null() with strict comparison operator
This commit is contained in:
+1
-1
@@ -95,7 +95,7 @@ class Url
|
||||
if (!isset($b['path'])) {
|
||||
$b['path'] = '/';
|
||||
}
|
||||
if (is_null($this->relativeUrl)) {
|
||||
if ($this->relativeUrl === null) {
|
||||
return $this->unparseUrl($b);
|
||||
}
|
||||
$r = $this->parseUrl($this->relativeUrl);
|
||||
|
||||
@@ -122,6 +122,13 @@ if [[ ! -z "${elses}" ]]; then
|
||||
((errors++))
|
||||
fi
|
||||
|
||||
# Prohibit use of "is_null" and suggest using the strict comparison operator.
|
||||
is_null=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec grep --color=always --line-number -H -e "is_null" {} \;)
|
||||
if [[ ! -z "${is_null}" ]]; then
|
||||
echo -e "${is_null}" | perl -pe 's/^(.*)$/is_null found in \1. Replace with strict comparison (e.g. "\$x === null")./'
|
||||
((errors++))
|
||||
fi
|
||||
|
||||
# Detect coding standard violations.
|
||||
phpcs --version
|
||||
phpcs \
|
||||
|
||||
Reference in New Issue
Block a user