From b59b249f12bd1500c0859e21a51ac8dd57489248 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Mon, 19 Aug 2013 13:36:27 -0500 Subject: [PATCH 01/11] Revert "Revert "Merge branch 'superdweebie-rand-bugfix'"" This reverts commit b0ae4689135d62555cf9bbe55cdd7dddcd2d8f05 in order to allow forward-porting fixes to develop. Conflicts: library/Zend/ModuleManager/ModuleEvent.php --- composer.json | 11 ++++++----- src/ArrayInput.php | 4 ++-- src/Input.php | 26 +++++++++++++++++++++++--- test/ArrayInputTest.php | 33 +++++++++++++++++++++++++++++++++ test/FileInputTest.php | 5 +++++ test/InputTest.php | 30 ++++++++++++++++++++++++++++++ 6 files changed, 99 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index f662e78a..0d3e04dd 100644 --- a/composer.json +++ b/composer.json @@ -17,6 +17,12 @@ "zendframework/zend-validator": "self.version", "zendframework/zend-stdlib": "self.version" }, + "require-dev": { + "zendframework/zend-servicemanager": "self.version", + "fabpot/php-cs-fixer": "1.7.*", + "satooshi/php-coveralls": "dev-master", + "phpunit/PHPUnit": "~4.0" + }, "suggest": { "zendframework/zend-servicemanager": "To support plugin manager support" }, @@ -31,10 +37,5 @@ "psr-4": { "ZendTest\\InputFilter\\": "test/" } - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "satooshi/php-coveralls": "dev-master", - "phpunit/PHPUnit": "~4.0" } } \ No newline at end of file diff --git a/src/ArrayInput.php b/src/ArrayInput.php index 5dec0151..3c5c4783 100644 --- a/src/ArrayInput.php +++ b/src/ArrayInput.php @@ -56,8 +56,8 @@ public function isValid($context = null) foreach ($values as $value) { $result = $validator->isValid($value, $context); if (!$result) { - if ($fallbackValue = $this->getFallbackValue()) { - $this->setValue($fallbackValue); + if ($this->hasFallback()) { + $this->setValue($this->getFallbackValue()); $result = true; } break; diff --git a/src/Input.php b/src/Input.php index da84df9e..7d302e8f 100644 --- a/src/Input.php +++ b/src/Input.php @@ -70,6 +70,11 @@ class Input implements InputInterface, EmptyContextInterface */ protected $fallbackValue; + /** + * @var bool + */ + protected $hasFallback = false; + public function __construct($name = null) { $this->name = $name; @@ -173,6 +178,7 @@ public function setValue($value) public function setFallbackValue($value) { $this->fallbackValue = $value; + $this->hasFallback = true; return $this; } @@ -271,6 +277,20 @@ public function getFallbackValue() return $this->fallbackValue; } + /** + * @return bool + */ + public function hasFallback() + { + return $this->hasFallback; + } + + public function clearFallbackValue() + { + $this->hasFallback = false; + $this->fallbackValue = null; + } + /** * @param InputInterface $input * @return Input @@ -308,8 +328,8 @@ public function isValid($context = null) $validator = $this->getValidatorChain(); $value = $this->getValue(); $result = $validator->isValid($value, $context); - if (!$result && $fallbackValue = $this->getFallbackValue()) { - $this->setValue($fallbackValue); + if (!$result && $this->hasFallback()) { + $this->setValue($this->getFallbackValue()); $result = true; } @@ -325,7 +345,7 @@ public function getMessages() return (array) $this->errorMessage; } - if ($this->getFallbackValue()) { + if ($this->hasFallback()) { return array(); } diff --git a/test/ArrayInputTest.php b/test/ArrayInputTest.php index fb7403ef..a0e17275 100644 --- a/test/ArrayInputTest.php +++ b/test/ArrayInputTest.php @@ -187,4 +187,37 @@ public function testDoNotInjectNotEmptyValidatorIfAnywhereInChain() $this->assertEquals(2, count($validators)); $this->assertEquals($notEmptyMock, $validators[1]['instance']); } + + public function dataFallbackValue() + { + return array( + array( + 'fallbackValue' => array() + ), + array( + 'fallbackValue' => array(''), + ), + array( + 'fallbackValue' => array(null), + ), + array( + 'fallbackValue' => array('some value'), + ), + ); + } + + /** + * @dataProvider dataFallbackValue + */ + public function testFallbackValue($fallbackValue) + { + $this->input->setFallbackValue($fallbackValue); + $validator = new Validator\Date(); + $this->input->getValidatorChain()->attach($validator); + $this->input->setValue(array('123')); // not a date + + $this->assertTrue($this->input->isValid()); + $this->assertEmpty($this->input->getMessages()); + $this->assertSame($fallbackValue, $this->input->getValue()); + } } diff --git a/test/FileInputTest.php b/test/FileInputTest.php index 22d18c40..a72a7987 100644 --- a/test/FileInputTest.php +++ b/test/FileInputTest.php @@ -340,4 +340,9 @@ public function testMerge() $filters = $filterChain->getFilters()->toArray(); $this->assertInstanceOf('Zend\Filter\StringTrim', $filters[0]); } + + public function testFallbackValue($fallbackValue = null) + { + $this->markTestSkipped('Not use fallback value'); + } } diff --git a/test/InputTest.php b/test/InputTest.php index f3638ffc..24338dd6 100644 --- a/test/InputTest.php +++ b/test/InputTest.php @@ -273,6 +273,36 @@ public function testDoNotInjectNotEmptyValidatorIfAnywhereInChain() $this->assertEquals($notEmptyMock, $validators[1]['instance']); } + public function dataFallbackValue() + { + return array( + array( + 'fallbackValue' => null + ), + array( + 'fallbackValue' => '' + ), + array( + 'fallbackValue' => 'some value' + ), + ); + } + + /** + * @dataProvider dataFallbackValue + */ + public function testFallbackValue($fallbackValue) + { + $this->input->setFallbackValue($fallbackValue); + $validator = new Validator\Date(); + $this->input->getValidatorChain()->attach($validator); + $this->input->setValue('123'); // not a date + + $this->assertTrue($this->input->isValid()); + $this->assertEmpty($this->input->getMessages()); + $this->assertSame($fallbackValue, $this->input->getValue()); + } + public function testMergeRetainsContinueIfEmptyFlag() { $input = new Input('foo'); From 9bc832218201d777be05c922df3a49a729af802c Mon Sep 17 00:00:00 2001 From: atodd Date: Tue, 10 Sep 2013 09:40:47 -0400 Subject: [PATCH 02/11] clear collection values when filtering an empty data --- src/BaseInputFilter.php | 4 ++++ src/CollectionInputFilter.php | 26 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/BaseInputFilter.php b/src/BaseInputFilter.php index 44ba46f6..f1083a88 100644 --- a/src/BaseInputFilter.php +++ b/src/BaseInputFilter.php @@ -525,6 +525,10 @@ protected function populate() // No value; clear value in this input if ($input instanceof InputFilterInterface) { $input->setData(array()); + if ($input instanceof CollectionInputFilter) { + $input->clearValues(); + $input->clearRawValues(); + } continue; } diff --git a/src/CollectionInputFilter.php b/src/CollectionInputFilter.php index f947fef6..f4441989 100644 --- a/src/CollectionInputFilter.php +++ b/src/CollectionInputFilter.php @@ -165,6 +165,12 @@ public function isValid() if (count($this->collectionData) < $this->getCount()) { $valid = false; } + + if (empty($this->collectionData)) { + $this->clearValues(); + $this->clearRawValues(); + return $valid; + } $inputs = $this->validationGroup ?: array_keys($this->inputs); foreach ($this->collectionData as $key => $data) { @@ -253,6 +259,26 @@ public function getRawValues() { return $this->collectionRawValues; } + + /** + * Clear collectionValues + * + * @access public + */ + public function clearValues() + { + return $this->collectionValues = array(); + } + + /** + * Clear collectionRawValues + * + * @access public + */ + public function clearRawValues() + { + return $this->collectionRawValues = array(); + } /** * {@inheritdoc} From af64af68c6b76b6d1f014c087a2819f1204bf29e Mon Sep 17 00:00:00 2001 From: atodd Date: Tue, 10 Sep 2013 09:43:55 -0400 Subject: [PATCH 03/11] update tests --- test/CollectionInputFilterTest.php | 99 +++++++++++++++++++++++++++++- 1 file changed, 96 insertions(+), 3 deletions(-) diff --git a/test/CollectionInputFilterTest.php b/test/CollectionInputFilterTest.php index d4c60d24..4b726b9c 100644 --- a/test/CollectionInputFilterTest.php +++ b/test/CollectionInputFilterTest.php @@ -392,7 +392,7 @@ public function testSetRequired() $this->assertEquals(true,$this->filter->getIsRequired()); } - public function testNestedCollection() + public function testNestedCollectionWithEmptyChild() { $items_inputfilter = new BaseInputFilter(); $items_inputfilter->add(new Input(), 'id') @@ -409,7 +409,41 @@ public function testNestedCollection() $inputFilter = new BaseInputFilter(); $inputFilter->add($groups, 'groups'); - $data = array( + $preFilterdata = array( + 'groups' => array( + array( + 'group_class' => 'bar', + 'items' => array( + array( + 'id' => 100, + 'type' => 'item-1', + ), + ), + ), + array( + 'group_class' => 'bar', + 'items' => array( + array( + 'id' => 200, + 'type' => 'item-2', + ), + array( + 'id' => 300, + 'type' => 'item-3', + ), + array( + 'id' => 400, + 'type' => 'item-4', + ), + ), + ), + array( + 'group_class' => 'biz', + ), + ), + ); + + $postFilterdata = array( 'groups' => array( array( 'group_class' => 'bar', @@ -439,13 +473,72 @@ public function testNestedCollection() ), array( 'group_class' => 'biz', + 'items' => array(), ), ), ); + $inputFilter->setData($preFilterdata); + $inputFilter->isValid(); + $values = $inputFilter->getValues(); + $this->assertEquals($postFilterdata, $values); + } + + public function testNestedCollectionWithEmptyData() + { + $items_inputfilter = new BaseInputFilter(); + $items_inputfilter->add(new Input(), 'id') + ->add(new Input(), 'type'); + $items = new CollectionInputFilter(); + $items->setInputFilter($items_inputfilter); + + $groups_inputfilter = new BaseInputFilter(); + $groups_inputfilter->add(new Input(), 'group_class') + ->add($items, 'items'); + $groups = new CollectionInputFilter(); + $groups->setInputFilter($groups_inputfilter); + + $inputFilter = new BaseInputFilter(); + $inputFilter->add($groups, 'groups'); + + $data = array( + 'groups' => array( + array( + 'group_class' => 'bar', + 'items' => array( + array( + 'id' => 100, + 'type' => 'item-1', + ), + ), + ), + array( + 'group_class' => 'biz', + 'items' => array(), + ), + array( + 'group_class' => 'bar', + 'items' => array( + array( + 'id' => 200, + 'type' => 'item-2', + ), + array( + 'id' => 300, + 'type' => 'item-3', + ), + array( + 'id' => 400, + 'type' => 'item-4', + ), + ), + ), + ), + ); + $inputFilter->setData($data); $inputFilter->isValid(); $values = $inputFilter->getValues(); - $this->assertSame($data, $values); + $this->assertEquals($data, $values); } } From 3a360c2046ce8b5335368f2ebbeefdc966886b40 Mon Sep 17 00:00:00 2001 From: atodd Date: Mon, 16 Sep 2013 10:09:17 -0400 Subject: [PATCH 04/11] remove trailing whitespace --- src/CollectionInputFilter.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/CollectionInputFilter.php b/src/CollectionInputFilter.php index f4441989..40774200 100644 --- a/src/CollectionInputFilter.php +++ b/src/CollectionInputFilter.php @@ -259,20 +259,20 @@ public function getRawValues() { return $this->collectionRawValues; } - + /** * Clear collectionValues - * + * * @access public */ public function clearValues() { return $this->collectionValues = array(); } - + /** * Clear collectionRawValues - * + * * @access public */ public function clearRawValues() From 7ed4a71c6679331eb516af64059432bbf26b65cf Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Tue, 22 Oct 2013 16:31:25 -0500 Subject: [PATCH 05/11] [zendframework/zf2#5106] CS fixes - trailing whitespace --- src/CollectionInputFilter.php | 2 +- test/CollectionInputFilterTest.php | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/CollectionInputFilter.php b/src/CollectionInputFilter.php index 40774200..98e029f8 100644 --- a/src/CollectionInputFilter.php +++ b/src/CollectionInputFilter.php @@ -165,7 +165,7 @@ public function isValid() if (count($this->collectionData) < $this->getCount()) { $valid = false; } - + if (empty($this->collectionData)) { $this->clearValues(); $this->clearRawValues(); diff --git a/test/CollectionInputFilterTest.php b/test/CollectionInputFilterTest.php index 4b726b9c..ebf61c8f 100644 --- a/test/CollectionInputFilterTest.php +++ b/test/CollectionInputFilterTest.php @@ -391,7 +391,7 @@ public function testSetRequired() $this->filter->setIsRequired(true); $this->assertEquals(true,$this->filter->getIsRequired()); } - + public function testNestedCollectionWithEmptyChild() { $items_inputfilter = new BaseInputFilter(); @@ -399,16 +399,16 @@ public function testNestedCollectionWithEmptyChild() ->add(new Input(), 'type'); $items = new CollectionInputFilter(); $items->setInputFilter($items_inputfilter); - + $groups_inputfilter = new BaseInputFilter(); $groups_inputfilter->add(new Input(), 'group_class') ->add($items, 'items'); $groups = new CollectionInputFilter(); $groups->setInputFilter($groups_inputfilter); - + $inputFilter = new BaseInputFilter(); $inputFilter->add($groups, 'groups'); - + $preFilterdata = array( 'groups' => array( array( @@ -442,7 +442,7 @@ public function testNestedCollectionWithEmptyChild() ), ), ); - + $postFilterdata = array( 'groups' => array( array( @@ -477,13 +477,13 @@ public function testNestedCollectionWithEmptyChild() ), ), ); - + $inputFilter->setData($preFilterdata); $inputFilter->isValid(); $values = $inputFilter->getValues(); $this->assertEquals($postFilterdata, $values); } - + public function testNestedCollectionWithEmptyData() { $items_inputfilter = new BaseInputFilter(); @@ -491,16 +491,16 @@ public function testNestedCollectionWithEmptyData() ->add(new Input(), 'type'); $items = new CollectionInputFilter(); $items->setInputFilter($items_inputfilter); - + $groups_inputfilter = new BaseInputFilter(); $groups_inputfilter->add(new Input(), 'group_class') ->add($items, 'items'); $groups = new CollectionInputFilter(); $groups->setInputFilter($groups_inputfilter); - + $inputFilter = new BaseInputFilter(); $inputFilter->add($groups, 'groups'); - + $data = array( 'groups' => array( array( @@ -535,7 +535,7 @@ public function testNestedCollectionWithEmptyData() ), ), ); - + $inputFilter->setData($data); $inputFilter->isValid(); $values = $inputFilter->getValues(); From a16233a698c12408375eb066f50f7c1393f1d07c Mon Sep 17 00:00:00 2001 From: Antoine Hedgecock Date: Sun, 22 Dec 2013 15:54:39 +0100 Subject: [PATCH 06/11] Added a test --- test/BaseInputFilterTest.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/BaseInputFilterTest.php b/test/BaseInputFilterTest.php index 04b57e48..d1509ff1 100644 --- a/test/BaseInputFilterTest.php +++ b/test/BaseInputFilterTest.php @@ -860,4 +860,20 @@ public function testIsValidWhenValuesSetOnFilters() $this->assertTrue($filter->get('foo')->isValid(), 'Filtered value is not valid'); $this->assertTrue($filter->isValid(), 'Input filter did return value from filter'); } + + /** + * @group 5638 + */ + public function testPopulateSupportsArrayInputEvenIfDataMissing() + { + $arrayInput = $this->getMock('Zend\InputFilter\ArrayInput'); + $arrayInput + ->expects($this->once()) + ->method('setValue') + ->with([]); + + $filter = new InputFilter(); + $filter->add($arrayInput, 'arrayInput'); + $filter->setData(array('foo' => 'bar')); + } } From 8143f103b06727a953aa838c367a98c9cabeafc5 Mon Sep 17 00:00:00 2001 From: Antoine Hedgecock Date: Mon, 23 Dec 2013 22:28:33 +0100 Subject: [PATCH 07/11] Removed php 5.4 array notation --- test/BaseInputFilterTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/BaseInputFilterTest.php b/test/BaseInputFilterTest.php index d1509ff1..a72db949 100644 --- a/test/BaseInputFilterTest.php +++ b/test/BaseInputFilterTest.php @@ -870,7 +870,7 @@ public function testPopulateSupportsArrayInputEvenIfDataMissing() $arrayInput ->expects($this->once()) ->method('setValue') - ->with([]); + ->with(array()); $filter = new InputFilter(); $filter->add($arrayInput, 'arrayInput'); From bebfbcffdc9e79564cb66c86ded13ebb41196486 Mon Sep 17 00:00:00 2001 From: Kathryn Reeve Date: Tue, 31 Dec 2013 16:11:41 +0000 Subject: [PATCH 08/11] copyright update for 2014 - Zend Library --- src/ArrayInput.php | 2 +- src/BaseInputFilter.php | 2 +- src/CollectionInputFilter.php | 2 +- src/EmptyContextInterface.php | 2 +- src/Exception/ExceptionInterface.php | 2 +- src/Exception/InvalidArgumentException.php | 2 +- src/Exception/RuntimeException.php | 2 +- src/Factory.php | 2 +- src/FileInput.php | 2 +- src/Input.php | 2 +- src/InputFilter.php | 2 +- src/InputFilterAwareInterface.php | 2 +- src/InputFilterAwareTrait.php | 2 +- src/InputFilterInterface.php | 2 +- src/InputFilterPluginManager.php | 2 +- src/InputFilterProviderInterface.php | 2 +- src/InputInterface.php | 2 +- src/InputProviderInterface.php | 2 +- src/UnknownInputsCapableInterface.php | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/ArrayInput.php b/src/ArrayInput.php index 3c5c4783..7ad68ecf 100644 --- a/src/ArrayInput.php +++ b/src/ArrayInput.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/BaseInputFilter.php b/src/BaseInputFilter.php index 91faa5da..0c4d7e8b 100644 --- a/src/BaseInputFilter.php +++ b/src/BaseInputFilter.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/CollectionInputFilter.php b/src/CollectionInputFilter.php index 98e029f8..cbe5091b 100644 --- a/src/CollectionInputFilter.php +++ b/src/CollectionInputFilter.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/EmptyContextInterface.php b/src/EmptyContextInterface.php index 72933b18..0a2270d7 100644 --- a/src/EmptyContextInterface.php +++ b/src/EmptyContextInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Exception/ExceptionInterface.php b/src/Exception/ExceptionInterface.php index d2c2451c..848fa2e5 100644 --- a/src/Exception/ExceptionInterface.php +++ b/src/Exception/ExceptionInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Exception/InvalidArgumentException.php b/src/Exception/InvalidArgumentException.php index db88b36a..3fcec0c6 100644 --- a/src/Exception/InvalidArgumentException.php +++ b/src/Exception/InvalidArgumentException.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Exception/RuntimeException.php b/src/Exception/RuntimeException.php index 207d7776..45ef3ee8 100644 --- a/src/Exception/RuntimeException.php +++ b/src/Exception/RuntimeException.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Factory.php b/src/Factory.php index 65400ade..438e3443 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/FileInput.php b/src/FileInput.php index 76a8bd4d..41d2e493 100644 --- a/src/FileInput.php +++ b/src/FileInput.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/Input.php b/src/Input.php index 7d302e8f..7f16b68c 100644 --- a/src/Input.php +++ b/src/Input.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/InputFilter.php b/src/InputFilter.php index 27060c8f..29073e91 100644 --- a/src/InputFilter.php +++ b/src/InputFilter.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/InputFilterAwareInterface.php b/src/InputFilterAwareInterface.php index 2da66cf1..bf4f2011 100644 --- a/src/InputFilterAwareInterface.php +++ b/src/InputFilterAwareInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/InputFilterAwareTrait.php b/src/InputFilterAwareTrait.php index 94c9d4c7..b16367cf 100644 --- a/src/InputFilterAwareTrait.php +++ b/src/InputFilterAwareTrait.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/InputFilterInterface.php b/src/InputFilterInterface.php index e7f4f11c..41bbfcfb 100644 --- a/src/InputFilterInterface.php +++ b/src/InputFilterInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/InputFilterPluginManager.php b/src/InputFilterPluginManager.php index 757e3dc2..ddee5e8e 100644 --- a/src/InputFilterPluginManager.php +++ b/src/InputFilterPluginManager.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/InputFilterProviderInterface.php b/src/InputFilterProviderInterface.php index 8811cc0c..3b57cc8b 100644 --- a/src/InputFilterProviderInterface.php +++ b/src/InputFilterProviderInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/InputInterface.php b/src/InputInterface.php index 6144ac11..85637654 100644 --- a/src/InputInterface.php +++ b/src/InputInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/InputProviderInterface.php b/src/InputProviderInterface.php index 5f596ede..f5298a19 100644 --- a/src/InputProviderInterface.php +++ b/src/InputProviderInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/src/UnknownInputsCapableInterface.php b/src/UnknownInputsCapableInterface.php index f2067961..1890307b 100644 --- a/src/UnknownInputsCapableInterface.php +++ b/src/UnknownInputsCapableInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ From 1c5d26a1d4508a0f5bd931283e7d7f2ba482c084 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Wed, 11 Dec 2013 14:30:42 +0700 Subject: [PATCH 09/11] [2.3.0] change php require version from 5.3.3 to 5.3.23 in all resources, and remove tests that no longer support 5.3.3 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0d3e04dd..f0107e80 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ } }, "require": { - "php": ">=5.3.3", + "php": ">=5.3.23", "zendframework/zend-filter": "self.version", "zendframework/zend-validator": "self.version", "zendframework/zend-stdlib": "self.version" From 6fdfc9e311851a527a8da335b988f046e7299aad Mon Sep 17 00:00:00 2001 From: fabiocarneiro Date: Thu, 6 Mar 2014 12:31:30 -0300 Subject: [PATCH 10/11] Test for CollectionInputFilter required option --- test/FactoryTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/FactoryTest.php b/test/FactoryTest.php index ffd3d539..83142cbf 100644 --- a/test/FactoryTest.php +++ b/test/FactoryTest.php @@ -439,12 +439,14 @@ public function testFactoryAcceptsCollectionInputFilter() $inputFilter = $factory->createInputFilter(array( 'type' => 'Zend\InputFilter\CollectionInputFilter', + 'required' => true, 'inputfilter' => new InputFilter(), 'count' => 3 )); $this->assertInstanceOf('Zend\InputFilter\CollectionInputFilter', $inputFilter); $this->assertInstanceOf('Zend\InputFilter\InputFilter', $inputFilter->getInputFilter()); + $this->assertTrue($inputFilter->getIsRequired()); $this->assertEquals(3, $inputFilter->getCount()); } From 0d7ca6ab0ff61cac46979e71366b5856d89aa2e7 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Fri, 7 Mar 2014 14:45:53 -0600 Subject: [PATCH 11/11] [zendframework/zf2#5926] CS fixes - Align operators - Comma after last array element --- test/FactoryTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/FactoryTest.php b/test/FactoryTest.php index e12e944d..f4289b4a 100644 --- a/test/FactoryTest.php +++ b/test/FactoryTest.php @@ -439,9 +439,9 @@ public function testFactoryAcceptsCollectionInputFilter() $inputFilter = $factory->createInputFilter(array( 'type' => 'Zend\InputFilter\CollectionInputFilter', - 'required' => true, + 'required' => true, 'inputfilter' => new InputFilter(), - 'count' => 3 + 'count' => 3, )); $this->assertInstanceOf('Zend\InputFilter\CollectionInputFilter', $inputFilter);