This repository was archived by the owner on Jan 30, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-9
lines changed
Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -307,12 +307,12 @@ public function createInputFilter($inputFilterSpecification)
307307 }
308308
309309 $ type = InputFilter::class;
310-
310+
311311 if (isset ($ inputFilterSpecification ['type ' ]) && is_string ($ inputFilterSpecification ['type ' ])) {
312312 $ type = $ inputFilterSpecification ['type ' ];
313313 unset($ inputFilterSpecification ['type ' ]);
314314 }
315-
315+
316316 $ inputFilter = $ this ->getInputFilterManager ()->get ($ type );
317317
318318 if ($ inputFilter instanceof CollectionInputFilter) {
@@ -339,17 +339,17 @@ public function createInputFilter($inputFilterSpecification)
339339 ) {
340340 $ input = $ value ;
341341 } else {
342-
342+
343343 // Patch to enable nested, integer indexed input_filter_specs
344- // InputFilter doesn't have an name property!
344+ // InputFilter doesn't have an name property!
345345 // But if the key is an integer and type and name are specified maybe we could use it.
346346 if (is_integer ($ key ) && isset ($ value ['type ' ]) && is_string ($ value ['type ' ])) {
347347 if (isset ($ value ['name ' ]) && is_string ($ value ['name ' ])) {
348348 $ key = $ value ['name ' ];
349349 unset($ value ['name ' ]);
350350 }
351351 }
352-
352+
353353 $ input = $ this ->createInput ($ value );
354354 }
355355
Original file line number Diff line number Diff line change @@ -918,26 +918,28 @@ public function testCreateInputFilterConfiguredNameWhenSpecIsIntegerIndexed()
918918 $ factory = $ this ->createDefaultFactory ();
919919 $ inputFilter = $ factory ->createInputFilter ([
920920 1 => [
921+ 'type ' => InputFilter::class,
921922 'name ' => 'foo ' ,
922923 ],
923924 ]);
924925
925926 $ this ->assertTrue ($ inputFilter ->has ('foo ' ));
926927 }
927-
928+
928929 public function testCreateInputFilterUsesAssociatedNameMappingOverConfiguredName ()
929930 {
930931 $ factory = $ this ->createDefaultFactory ();
931932 $ inputFilter = $ factory ->createInputFilter ([
932933 'foo ' => [
934+ 'type ' => InputFilter::class,
933935 'name ' => 'bar ' ,
934936 ],
935937 ]);
936938
937939 $ this ->assertTrue ($ inputFilter ->has ('foo ' ));
938940 $ this ->assertFalse ($ inputFilter ->has ('bar ' ));
939941 }
940-
942+
941943 public function testCreateInputFilterUsesConfiguredNameForNestedInputFilters ()
942944 {
943945 $ factory = $ this ->createDefaultFactory ();
@@ -979,7 +981,7 @@ public function testCreateInputFilterUsesConfiguredNameForNestedInputFilters()
979981 $ this ->assertEquals (1 , count ($ collectionInputFilter ));
980982 $ this ->assertTrue ($ collectionInputFilter ->has ('bat ' ));
981983 }
982-
984+
983985 /**
984986 * @return Factory
985987 */
Original file line number Diff line number Diff line change 1313use PHPUnit_Framework_MockObject_MockObject as MockObject ;
1414use PHPUnit_Framework_TestCase as TestCase ;
1515use Zend \Filter \FilterPluginManager ;
16- use Zend \InputFilter \CollectionInputFilter ;
1716use Zend \InputFilter \InputFilterAbstractServiceFactory ;
1817use Zend \InputFilter \InputFilterInterface ;
1918use Zend \InputFilter \InputFilterPluginManager ;
You can’t perform that action at this time.
0 commit comments