File tree Expand file tree Collapse file tree 2 files changed +1
-7
lines changed
src/Illuminate/Validation/Rules Expand file tree Collapse file tree 2 files changed +1
-7
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ class RequiredIf
21
21
*/
22
22
public function __construct ($ condition )
23
23
{
24
- if (! is_string ($ condition ) && ( is_bool ( $ condition ) || is_callable ( $ condition )) ) {
24
+ if (! is_string ($ condition )) {
25
25
$ this ->condition = $ condition ;
26
26
} else {
27
27
throw new InvalidArgumentException ('The provided condition must be a callable or boolean. ' );
Original file line number Diff line number Diff line change @@ -39,10 +39,6 @@ public function testItOnlyCallableAndBooleanAreAcceptableArgumentsOfTheRule()
39
39
$ this ->expectException (\InvalidArgumentException::class);
40
40
41
41
$ rule = new RequiredIf ('phpinfo ' );
42
-
43
- $ rule = new RequiredIf (12.3 );
44
-
45
- $ rule = new RequiredIf (new stdClass ());
46
42
}
47
43
48
44
public function testItReturnedRuleIsNotSerializable ()
@@ -52,7 +48,5 @@ public function testItReturnedRuleIsNotSerializable()
52
48
$ rule = serialize (new RequiredIf (function () {
53
49
return true ;
54
50
}));
55
-
56
- $ rule = serialize (new RequiredIf ());
57
51
}
58
52
}
You can’t perform that action at this time.
0 commit comments