This repository was archived by the owner on Jan 30, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +303
-38
lines changed Expand file tree Collapse file tree 2 files changed +303
-38
lines changed Original file line number Diff line number Diff line change 10
10
namespace Zend \InputFilter ;
11
11
12
12
use Traversable ;
13
- use Zend \Filter \Exception ;
14
13
use Zend \Filter \FilterChain ;
15
14
use Zend \ServiceManager \ServiceLocatorInterface ;
16
15
use Zend \Stdlib \ArrayUtils ;
@@ -220,12 +219,26 @@ public function createInput($inputSpecification)
220
219
}
221
220
break ;
222
221
case 'continue_if_empty ' :
222
+ if (!$ input instanceof Input) {
223
+ throw new Exception \RuntimeException (sprintf (
224
+ '%s "continue_if_empty" can only set to inputs of type "%s" ' ,
225
+ __METHOD__ ,
226
+ Input::class
227
+ ));
228
+ }
223
229
$ input ->setContinueIfEmpty ($ inputSpecification ['continue_if_empty ' ]);
224
230
break ;
225
231
case 'error_message ' :
226
232
$ input ->setErrorMessage ($ value );
227
233
break ;
228
234
case 'fallback_value ' :
235
+ if (!$ input instanceof Input) {
236
+ throw new Exception \RuntimeException (sprintf (
237
+ '%s "fallback_value" can only set to inputs of type "%s" ' ,
238
+ __METHOD__ ,
239
+ Input::class
240
+ ));
241
+ }
229
242
$ input ->setFallbackValue ($ value );
230
243
break ;
231
244
case 'break_on_failure ' :
You can’t perform that action at this time.
0 commit comments