File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ private function absolutizeUrl()
95
95
if (!isset ($ b ['path ' ])) {
96
96
$ b ['path ' ] = '/ ' ;
97
97
}
98
- if (is_null ( $ this ->relativeUrl ) ) {
98
+ if ($ this ->relativeUrl === null ) {
99
99
return $ this ->unparseUrl ($ b );
100
100
}
101
101
$ r = $ this ->parseUrl ($ this ->relativeUrl );
Original file line number Diff line number Diff line change @@ -122,6 +122,13 @@ if [[ ! -z "${elses}" ]]; then
122
122
(( errors++ ))
123
123
fi
124
124
125
+ # Prohibit use of "is_null" and suggest using the strict comparison operator.
126
+ is_null=$( find . -type " f" -iname " *.php" ! -path " */vendor/*" -exec grep --color=always --line-number -H -e " is_null" {} \; )
127
+ if [[ ! -z " ${is_null} " ]]; then
128
+ echo -e " ${is_null} " | perl -pe ' s/^(.*)$/is_null found in \1. Replace with strict comparison (e.g. "\$x === null")./'
129
+ (( errors++ ))
130
+ fi
131
+
125
132
# Detect coding standard violations.
126
133
phpcs --version
127
134
phpcs \
You can’t perform that action at this time.
0 commit comments