File tree 1 file changed +4
-9
lines changed
1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -111,18 +111,13 @@ public function parseGroups(string $regex): ?RegexAstWalkResult
111
111
);
112
112
113
113
// we could handle numeric-string, in case we know the regex is delimited by ^ and $
114
- $ accessories = [];
115
114
if ($ subjectAsGroupResult ->isNonFalsy ()->yes ()) {
116
- $ accessories [] = new AccessoryNonFalsyStringType ();
115
+ $ astWalkResult = $ astWalkResult ->withSubjectBaseType (
116
+ TypeCombinator::intersect (new StringType (), new AccessoryNonFalsyStringType ()),
117
+ );
117
118
} elseif ($ subjectAsGroupResult ->isNonEmpty ()->yes ()) {
118
- $ accessories [] = new AccessoryNonEmptyStringType ();
119
- }
120
-
121
- if ($ accessories !== []) {
122
- $ accessories [] = new StringType ();
123
-
124
119
$ astWalkResult = $ astWalkResult ->withSubjectBaseType (
125
- TypeCombinator::intersect (... $ accessories ),
120
+ TypeCombinator::intersect (new StringType (), new AccessoryNonEmptyStringType () ),
126
121
);
127
122
}
128
123
You can’t perform that action at this time.
0 commit comments