Skip to content

Commit

Permalink
Feedbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
bakura10 committed Apr 26, 2013
1 parent f8f2892 commit ee439e3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion library/Zend/InputFilter/BaseInputFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class BaseInputFilter implements InputFilterInterface, UnknownInputsCapableInter
public function init()
{
}

/**
* Countable: number of inputs in this input filter
*
Expand Down
13 changes: 7 additions & 6 deletions library/Zend/InputFilter/InputFilterPluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Zend\InputFilter\Exception;
use Zend\ServiceManager\AbstractPluginManager;
use Zend\ServiceManager\ConfigInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Zend\Stdlib\InitializableInterface;

/**
Expand All @@ -36,7 +37,7 @@ public function __construct(ConfigInterface $configuration = null)
*/
public function populateFactory($element)
{
if ($element instanceof InputFilter) {
if ($element instanceof InputFilter && $this->serviceLocator instanceof ServiceLocatorInterface) {
$factory = $element->getFactory();
$factory->getDefaultFilterChain()->setPluginManager($this->serviceLocator->get('FilterManager'));
$factory->getDefaultValidatorChain()->setPluginManager($this->serviceLocator->get('ValidatorManager'));
Expand All @@ -48,12 +49,12 @@ public function populateFactory($element)
*/
public function validatePlugin($plugin)
{
// Hook to perform various initialization, when the element is not created through the factory
if ($plugin instanceof InitializableInterface) {
$plugin->init();
}

if ($plugin instanceof InputFilterInterface) {
// Hook to perform various initialization, when the element is not created through the factory
if ($plugin instanceof InitializableInterface) {
$plugin->init();
}

// we're okay
return;
}
Expand Down
4 changes: 1 addition & 3 deletions tests/ZendTest/InputFilter/InputFilterManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Form
*/

namespace ZendTest\InputFilter;
Expand All @@ -14,8 +13,7 @@
use Zend\InputFilter\InputFilterPluginManager;

/**
* @category Zend
* @group Zend_Stdlib
* @group Zend_Stdlib
*/
class InputFilterManagerTest extends \PHPUnit_Framework_TestCase
{
Expand Down
4 changes: 1 addition & 3 deletions tests/ZendTest/Stdlib/Hydrator/HydratorManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Form
*/

namespace ZendTest\Stdlib\Hydrator;
Expand All @@ -14,8 +13,7 @@
use Zend\Stdlib\Hydrator\HydratorPluginManager;

/**
* @category Zend
* @group Zend_Stdlib
* @group Zend_Stdlib
*/
class HydratorManagerTest extends \PHPUnit_Framework_TestCase
{
Expand Down

0 comments on commit ee439e3

Please sign in to comment.