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 1010namespace Zend \InputFilter ;
1111
1212use Traversable ;
13- use Zend \Filter \Exception ;
1413use Zend \Filter \FilterChain ;
1514use Zend \ServiceManager \ServiceLocatorInterface ;
1615use Zend \Stdlib \ArrayUtils ;
@@ -220,12 +219,26 @@ public function createInput($inputSpecification)
220219 }
221220 break ;
222221 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+ }
223229 $ input ->setContinueIfEmpty ($ inputSpecification ['continue_if_empty ' ]);
224230 break ;
225231 case 'error_message ' :
226232 $ input ->setErrorMessage ($ value );
227233 break ;
228234 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+ }
229242 $ input ->setFallbackValue ($ value );
230243 break ;
231244 case 'break_on_failure ' :
You can’t perform that action at this time.
0 commit comments