File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -104,11 +104,12 @@ function flash()
104
104
105
105
if (null !== $ flash ) {
106
106
if (!$ this ->isValidBool ($ flash )) {
107
- throw new InvalidOptionalArgumentException ("flash can be either 1 or 0. " );
107
+ throw new InvalidOptionalArgumentException ("Argument ' flash' can be either 1 or 0. " );
108
108
}
109
109
110
110
if ("direct " != $ this ->parameters ["type " ] && $ flash ) {
111
- throw new InvalidOptionalArgumentException ("Only messages of type direct can be sent as flash messages. " );
111
+ throw new InvalidOptionalArgumentException (
112
+ "Only messages of type 'direct' can be sent as 'flash' messages. " );
112
113
}
113
114
114
115
}
@@ -127,15 +128,16 @@ function from()
127
128
$ isNumeric = is_numeric ($ from );
128
129
129
130
if ($ length > $ numericMax ) {
130
- throw new InvalidOptionalArgumentException ("from is too long as it exceeds $ numericMax characters . " );
131
+ throw new InvalidOptionalArgumentException ("Argument ' from' may not exceed $ numericMax chars . " );
131
132
}
132
133
133
- if ($ length > $ alphaNumericMax ) {
134
- if (!$ isNumeric ) {
135
- throw new InvalidOptionalArgumentException ("from longer than $ alphaNumericMax characters must be numeric. " );
136
- }
137
- } elseif (!$ isNumeric || !ctype_alnum ($ from )) {
138
- throw new InvalidOptionalArgumentException ("from does not seem to be a valid sender. " );
134
+ if ($ length > $ alphaNumericMax && !$ isNumeric ) {
135
+ throw new InvalidOptionalArgumentException (
136
+ "Argument 'from' must be numeric. if > $ alphaNumericMax chars. " );
137
+ }
138
+
139
+ if (!ctype_alnum ($ from )) {
140
+ throw new InvalidOptionalArgumentException ("Argument 'from' must be alphanumeric. " );
139
141
}
140
142
}
141
143
}
You can’t perform that action at this time.
0 commit comments