Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade zend-hydrator 3.0 #688

Open
wants to merge 6 commits into
base: 3.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public function getViewHelperConfig()
'zfcUserIdentity' => \ZfcUser\Factory\View\Helper\ZfcUserIdentity::class,
'zfcUserLoginWidget' => \ZfcUser\Factory\View\Helper\ZfcUserLoginWidget::class,
),
'aliases' => array(
'ZfcUserIdentity' => 'zfcUserIdentity',
),
);

}
Expand All @@ -55,7 +58,7 @@ public function getServiceConfig()
'zfcuser_zend_db_adapter' => \Zend\Db\Adapter\Adapter::class,
),
'invokables' => array(
'zfcuser_register_form_hydrator' => \Zend\Hydrator\ClassMethods::class,
'zfcuser_register_form_hydrator' => \Laminas\Hydrator\ClassMethodsHydrator::class,
),
'factories' => array(
'zfcuser_redirect_callback' => \ZfcUser\Factory\Controller\RedirectCallbackFactory::class,
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
}
},
"require": {
"php": "^5.5|^7.0",
"php": "^7.2|~8.0",
"zendframework/zend-authentication": "^2.5",
"zendframework/zend-crypt": "^3.0",
"zendframework/zend-form": "^2.9",
Expand All @@ -43,7 +43,7 @@
"zendframework/zend-mvc-plugin-flashmessenger": "^1.0",
"zendframework/zend-i18n": "^2.7",
"zendframework/zend-mvc-plugin-prg": "^1.0",
"zendframework/zend-hydrator": "^2.0"
"zendframework/zend-hydrator": "^3.0"
},
"require-dev" : {
"phpunit/phpunit" : ">=3.7,<4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __invoke(ContainerInterface $serviceLocator, $requestedName, arr
*/
public function createService(ServiceLocatorInterface $serviceManager)
{
$serviceLocator = $serviceManager->getServiceLocator();
$serviceLocator = $serviceManager;

return $this->__invoke($serviceLocator, null);
}
Expand Down
2 changes: 1 addition & 1 deletion src/ZfcUser/Factory/Controller/UserControllerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __invoke(ContainerInterface $serviceManager, $requestedName, arr
public function createService(ServiceLocatorInterface $controllerManager)
{
/* @var ControllerManager $controllerManager*/
$serviceManager = $controllerManager->getServiceLocator();
$serviceManager = $controllerManager;

return $this->__invoke($serviceManager, null);
}
Expand Down
2 changes: 1 addition & 1 deletion src/ZfcUser/Factory/UserHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class UserHydrator implements FactoryInterface
{
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
return new \Zend\Hydrator\ClassMethods();
return new \Laminas\Hydrator\ClassMethodsHydrator();
}


Expand Down
6 changes: 3 additions & 3 deletions src/ZfcUser/Mapper/AbstractDbMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Zend\Db\Sql\Sql;
use Zend\Db\Sql\TableIdentifier;
use Zend\Hydrator\HydratorInterface;
use Zend\Hydrator\ClassMethods;
use Laminas\Hydrator\ClassMethodsHydrator;
use ZfcUser\Entity\UserInterface as UserEntityInterface;
use ZfcUser\EventManager\EventProvider;
use ZfcUser\Db\Adapter\MasterSlaveAdapterInterface;
Expand Down Expand Up @@ -79,7 +79,7 @@ protected function initialize()
throw new \Exception('No db adapter present');
}
if (!$this->hydrator instanceof HydratorInterface) {
$this->hydrator = new ClassMethods;
$this->hydrator = new ClassMethodsHydrator;
}
if (!is_object($this->entityPrototype)) {
throw new \Exception('No entity prototype set');
Expand Down Expand Up @@ -242,7 +242,7 @@ public function setDbSlaveAdapter(Adapter $dbSlaveAdapter)
public function getHydrator()
{
if (!$this->hydrator) {
$this->hydrator = new ClassMethods(false);
$this->hydrator = new ClassMethodsHydrator(false);
}
return $this->hydrator;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ZfcUser/Mapper/UserHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Zend\Hydrator\ClassMethods;
use ZfcUser\Entity\UserInterface as UserEntityInterface;

class UserHydrator extends ClassMethods
class UserHydrator extends \Laminas\Hydrator\ClassMethodsHydrator
{
/**
* Extract values from an object
Expand Down
4 changes: 2 additions & 2 deletions tests/ZfcUserTest/Factory/Form/RegisterFormFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use Zend\Form\FormElementManager;
use Zend\ServiceManager\ServiceManager;
use Zend\Hydrator\ClassMethods;
use Laminas\Hydrator\ClassMethodsHydrator;
use ZfcUser\Factory\Form\Register as RegisterFactory;
use ZfcUser\Options\ModuleOptions;
use ZfcUser\Mapper\User as UserMapper;
Expand All @@ -15,7 +15,7 @@ public function testFactory()
$serviceManager = new ServiceManager;
$serviceManager->setService('zfcuser_module_options', new ModuleOptions);
$serviceManager->setService('zfcuser_user_mapper', new UserMapper);
$serviceManager->setService('zfcuser_register_form_hydrator', new ClassMethods());
$serviceManager->setService('zfcuser_register_form_hydrator', new ClassMethodsHydrator());

$formElementManager = new FormElementManager($serviceManager);
$serviceManager->setService('FormElementManager', $formElementManager);
Expand Down