Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Commit 501df79

Browse files
committed
Merge branch 'hotfix/43' into develop
Forward port #43
2 parents ee17cb7 + 2a23e74 commit 501df79

File tree

2 files changed

+303
-38
lines changed

2 files changed

+303
-38
lines changed

src/Factory.php

+14-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
namespace Zend\InputFilter;
1111

1212
use Traversable;
13-
use Zend\Filter\Exception;
1413
use Zend\Filter\FilterChain;
1514
use Zend\ServiceManager\ServiceLocatorInterface;
1615
use 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':

0 commit comments

Comments
 (0)