File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
system/Validation/StrictRules
tests/system/Validation/StrictRules Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,10 @@ public function greater_than($str, string $min): bool
79
79
$ str = (string ) $ str ;
80
80
}
81
81
82
+ if (! is_string ($ str )) {
83
+ return false ;
84
+ }
85
+
82
86
return $ this ->nonStrictRules ->greater_than ($ str , $ min );
83
87
}
84
88
@@ -93,6 +97,10 @@ public function greater_than_equal_to($str, string $min): bool
93
97
$ str = (string ) $ str ;
94
98
}
95
99
100
+ if (! is_string ($ str )) {
101
+ return false ;
102
+ }
103
+
96
104
return $ this ->nonStrictRules ->greater_than_equal_to ($ str , $ min );
97
105
}
98
106
@@ -157,6 +165,10 @@ public function less_than($str, string $max): bool
157
165
$ str = (string ) $ str ;
158
166
}
159
167
168
+ if (! is_string ($ str )) {
169
+ return false ;
170
+ }
171
+
160
172
return $ this ->nonStrictRules ->less_than ($ str , $ max );
161
173
}
162
174
@@ -171,6 +183,10 @@ public function less_than_equal_to($str, string $max): bool
171
183
$ str = (string ) $ str ;
172
184
}
173
185
186
+ if (! is_string ($ str )) {
187
+ return false ;
188
+ }
189
+
174
190
return $ this ->nonStrictRules ->less_than_equal_to ($ str , $ max );
175
191
}
176
192
Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ public function provideGreaterThanEqualStrict(): Generator
104
104
[0 , '0 ' , true ],
105
105
[1 , '0 ' , true ],
106
106
[-1 , '0 ' , false ],
107
+ [true , '0 ' , false ],
107
108
];
108
109
}
109
110
@@ -127,6 +128,7 @@ public function provideGreaterThanStrict(): Generator
127
128
[10 , '9 ' , true ],
128
129
[10 , '10 ' , false ],
129
130
[10 , 'a ' , false ],
131
+ [true , '0 ' , false ],
130
132
];
131
133
}
132
134
@@ -151,6 +153,7 @@ public function provideLessThanStrict(): Generator
151
153
[10 , '9 ' , false ],
152
154
[10 , '10 ' , false ],
153
155
[10 , 'a ' , true ],
156
+ [true , '0 ' , false ],
154
157
];
155
158
}
156
159
@@ -173,6 +176,7 @@ public function provideLessThanEqualStrict(): Generator
173
176
[0 , '0 ' , true ],
174
177
[1 , '0 ' , false ],
175
178
[-1 , '0 ' , true ],
179
+ [true , '0 ' , false ],
176
180
];
177
181
}
178
182
}
You can’t perform that action at this time.
0 commit comments