From d69f6614029c4fc944bcc2fe4d911954bb736137 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Thu, 3 Dec 2020 09:13:47 +0700 Subject: [PATCH 1/6] upgrade zend-hydrator 3.0 --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 20d18582..36f6f638 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ } }, "require": { - "php": "^5.5|^7.0", + "php": "^7.2", "zendframework/zend-authentication": "^2.5", "zendframework/zend-crypt": "^3.0", "zendframework/zend-form": "^2.9", @@ -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", From 5e5013b70be1ad25183e4a50f5bfa5d6871f0616 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Thu, 14 Jan 2021 14:11:15 +0700 Subject: [PATCH 2/6] allow php 8 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 36f6f638..44fba6ff 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ } }, "require": { - "php": "^7.2", + "php": "^7.2|~8.0", "zendframework/zend-authentication": "^2.5", "zendframework/zend-crypt": "^3.0", "zendframework/zend-form": "^2.9", From 88087c80d2796e41d8ab54b95b04a12c54331269 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Thu, 28 Jan 2021 01:57:34 +0700 Subject: [PATCH 3/6] use Laminas\Hydrator\ClassMethodsHydrator --- src/ZfcUser/Factory/UserHydrator.php | 2 +- src/ZfcUser/Mapper/AbstractDbMapper.php | 6 +++--- tests/ZfcUserTest/Factory/Form/RegisterFormFactoryTest.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ZfcUser/Factory/UserHydrator.php b/src/ZfcUser/Factory/UserHydrator.php index 33a5f148..8dc79816 100644 --- a/src/ZfcUser/Factory/UserHydrator.php +++ b/src/ZfcUser/Factory/UserHydrator.php @@ -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(); } diff --git a/src/ZfcUser/Mapper/AbstractDbMapper.php b/src/ZfcUser/Mapper/AbstractDbMapper.php index 7ffd4158..afe7081d 100644 --- a/src/ZfcUser/Mapper/AbstractDbMapper.php +++ b/src/ZfcUser/Mapper/AbstractDbMapper.php @@ -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; @@ -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'); @@ -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; } diff --git a/tests/ZfcUserTest/Factory/Form/RegisterFormFactoryTest.php b/tests/ZfcUserTest/Factory/Form/RegisterFormFactoryTest.php index 1dc67c3d..ac58003f 100644 --- a/tests/ZfcUserTest/Factory/Form/RegisterFormFactoryTest.php +++ b/tests/ZfcUserTest/Factory/Form/RegisterFormFactoryTest.php @@ -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; @@ -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); From 0397829d6063a7d03ad23a2988577ed1fa9f1216 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Thu, 28 Jan 2021 02:09:35 +0700 Subject: [PATCH 4/6] use Laminas\Hydrator\ClassMethodsHydrator --- Module.php | 2 +- src/ZfcUser/Mapper/UserHydrator.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Module.php b/Module.php index 7e2263d6..5cb5eed4 100644 --- a/Module.php +++ b/Module.php @@ -55,7 +55,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, diff --git a/src/ZfcUser/Mapper/UserHydrator.php b/src/ZfcUser/Mapper/UserHydrator.php index d7e45812..2f4c3565 100644 --- a/src/ZfcUser/Mapper/UserHydrator.php +++ b/src/ZfcUser/Mapper/UserHydrator.php @@ -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 From ae117f8a78ffe3f178ee75ebe8a73fe1ab5e7c7a Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Thu, 28 Jan 2021 08:17:05 +0700 Subject: [PATCH 5/6] remove ->getServiceLocator() call --- src/ZfcUser/Factory/Controller/Plugin/ZfcUserAuthentication.php | 2 +- src/ZfcUser/Factory/Controller/UserControllerFactory.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ZfcUser/Factory/Controller/Plugin/ZfcUserAuthentication.php b/src/ZfcUser/Factory/Controller/Plugin/ZfcUserAuthentication.php index c11a45ce..12009cbf 100644 --- a/src/ZfcUser/Factory/Controller/Plugin/ZfcUserAuthentication.php +++ b/src/ZfcUser/Factory/Controller/Plugin/ZfcUserAuthentication.php @@ -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); } diff --git a/src/ZfcUser/Factory/Controller/UserControllerFactory.php b/src/ZfcUser/Factory/Controller/UserControllerFactory.php index 760d9887..e6a1a206 100644 --- a/src/ZfcUser/Factory/Controller/UserControllerFactory.php +++ b/src/ZfcUser/Factory/Controller/UserControllerFactory.php @@ -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); } From ff0792c6e88a5f017e3d2eb43bc8e78b068bd79a Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Fri, 2 Apr 2021 21:32:18 +0700 Subject: [PATCH 6/6] alias ZfcUserIdentity --- Module.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Module.php b/Module.php index 5cb5eed4..5ac7ba43 100644 --- a/Module.php +++ b/Module.php @@ -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', + ), ); }