Skip to content
This repository has been archived by the owner on Feb 7, 2021. It is now read-only.

Commit

Permalink
Merge pull request #39 from Laminas-Commons/laminas-3.x
Browse files Browse the repository at this point in the history
Laminas 3.x
  • Loading branch information
matwright authored Sep 4, 2020
2 parents 0f12549 + 15506eb commit f8fbdda
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function getServiceConfig()
'lmcuser_laminas_db_adapter' => \Laminas\Db\Adapter\Adapter::class,
),
'invokables' => array(
'lmcuser_register_form_hydrator' => \Laminas\Hydrator\ClassMethods::class,
'lmcuser_register_form_hydrator' => \Laminas\Hydrator\ClassMethodsHydrator::class,
),
'factories' => array(
'lmcuser_redirect_callback' => \LmcUser\Factory\Controller\RedirectCallbackFactory::class,
Expand Down
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,10 @@
"classmap": [
"./Module.php"
]
},
"autoload-dev": {
"psr-0": {
"LmcUserTest": "tests/"
}
}
}
17 changes: 4 additions & 13 deletions src/LmcUser/Factory/UserHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,15 @@

use Interop\Container\ContainerInterface;
use Laminas\ServiceManager\Factory\FactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;

class UserHydrator implements FactoryInterface
{
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
return new \Laminas\Hydrator\ClassMethods();
}


/**
* Create service
*
* @param ServiceLocatorInterface $serviceLocator
* @return mixed
* {@inheritDoc}
* @see \Laminas\ServiceManager\Factory\FactoryInterface::__invoke()
*/
public function createService(ServiceLocatorInterface $serviceLocator)
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
return $this->__invoke($serviceLocator, null);
return new \Laminas\Hydrator\ClassMethodsHydrator();
}
}
8 changes: 4 additions & 4 deletions src/LmcUser/Mapper/AbstractDbMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
use Laminas\Db\Sql\Select;
use Laminas\Db\Sql\Sql;
use Laminas\Db\Sql\TableIdentifier;
use Laminas\Hydrator\ClassMethodsHydrator;
use Laminas\Hydrator\HydratorInterface;
use Laminas\Hydrator\ClassMethods;
use LmcUser\Db\Adapter\MasterSlaveAdapterInterface;
use LmcUser\Entity\UserInterface as UserEntityInterface;
use LmcUser\EventManager\EventProvider;
use LmcUser\Db\Adapter\MasterSlaveAdapterInterface;

abstract class AbstractDbMapper extends EventProvider
{
Expand Down Expand Up @@ -80,7 +80,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 @@ -243,7 +243,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/LmcUser/Service/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public function setServiceManager(ContainerInterface $serviceManager)
/**
* Return the Form Hydrator
*
* @return \Laminas\Hydrator\ClassMethods
* @return \Laminas\Hydrator\ClassMethodsHydrator
*/
public function getFormHydrator()
{
Expand Down
1 change: 0 additions & 1 deletion tests/LmcUserTest/Factory/Form/RegisterFormFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
use Laminas\Form\FormElementManager;
use Laminas\Hydrator\ClassMethodsHydrator;
use Laminas\ServiceManager\ServiceManager;
use Laminas\Hydrator\ClassMethods;
use LmcUser\Factory\Form\Register as RegisterFactory;
use LmcUser\Options\ModuleOptions;
use LmcUser\Mapper\User as UserMapper;
Expand Down

0 comments on commit f8fbdda

Please sign in to comment.