diff --git a/composer.json b/composer.json index d60cc0d..650191e 100644 --- a/composer.json +++ b/composer.json @@ -90,11 +90,11 @@ "laminas/laminas-view": ">=2.8", "laminas/laminas-xml2json": ">=3.0", "laminas/laminas-xmlrpc": ">=2.6", - "zendframework/zendxml": ">=1.0.2", "hhxsv5/php-sse": "~2.0", "lm-commons/lmc-cors": "^1.2", "laminas/laminas-cli": "^1.4", - "playground/doctrine-data-fixture-module": "^1.1" + "playground/doctrine-data-fixture-module": "^1.1", + "laminas/laminas-xml": "^1.4" }, "require-dev": { "phpunit/phpunit": ">=4.0.0", diff --git a/config/module.config.php b/config/module.config.php index fbf2716..935bb8a 100644 --- a/config/module.config.php +++ b/config/module.config.php @@ -33,9 +33,9 @@ 'doctrine' => array( 'driver' => array( 'playgroundcore_entity' => array( - 'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver', + 'class' => \Doctrine\ORM\Mapping\Driver\AnnotationDriver::class, 'cache' => 'array', - 'paths' => __DIR__ . '/../src/Entity' + 'paths' => [__DIR__ . '/../src/Entity'] ), 'orm_default' => array( @@ -47,7 +47,7 @@ 'connection' => array( // default connection name 'orm_default' => array( - 'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver', + 'driverClass' => \Doctrine\DBAL\Driver\PDO\MySQL\Driver::class, 'params' => array( 'host' => '127.0.0.1', 'port' => '3306', diff --git a/src/Controller/Admin/WebsiteController.php b/src/Controller/Admin/WebsiteController.php index cc83a1b..f11a9af 100644 --- a/src/Controller/Admin/WebsiteController.php +++ b/src/Controller/Admin/WebsiteController.php @@ -45,7 +45,7 @@ public function indexAction() public function listAction() { $locales = $this->getLocaleService()->getLocaleMapper()->findBy(array('active_front' => 1)); - $user = $this->zfcUserAuthentication()->getIdentity(); + $user = $this->lmcUserAuthentication()->getIdentity(); $websites = $this->getWebsiteService()->getWebsiteMapper()->findAll(); diff --git a/src/Stdlib/Hydrator/DoctrineObject.php b/src/Stdlib/Hydrator/DoctrineObject.php index 3cf6b73..b417dba 100644 --- a/src/Stdlib/Hydrator/DoctrineObject.php +++ b/src/Stdlib/Hydrator/DoctrineObject.php @@ -3,7 +3,7 @@ namespace PlaygroundCore\Stdlib\Hydrator; use DateTime; -use Doctrine\Common\Persistence\ObjectManager; +use Doctrine\Persistence\ObjectManager; /** * @@ -12,7 +12,7 @@ * having to fix a DoctrineModule bug :( https://github.com/doctrine/DoctrineModule/issues/180 * so i've extended DoctrineHydrator ... */ -class DoctrineObject extends \DoctrineModule\Stdlib\Hydrator\DoctrineObject +class DoctrineObject extends \Doctrine\Laminas\Hydrator\DoctrineObject { /** @@ -22,9 +22,9 @@ class DoctrineObject extends \DoctrineModule\Stdlib\Hydrator\DoctrineObject * @param string $targetClass The FQCN of the hydrated/extracted object * @param bool $byValue If set to true, hydrator will always use entity's public API */ - public function __construct(ObjectManager $objectManager, $targetClass, $byValue = true) + public function __construct(ObjectManager $objectManager, bool $byValue = true, ?Inflector $inflector = null) { - parent::__construct($objectManager, $targetClass, $byValue); + parent::__construct($objectManager, $byValue, $inflector); } /** diff --git a/src/Stdlib/Hydrator/Strategy/ObjectStrategy.php b/src/Stdlib/Hydrator/Strategy/ObjectStrategy.php index 8a3470b..0f86d46 100644 --- a/src/Stdlib/Hydrator/Strategy/ObjectStrategy.php +++ b/src/Stdlib/Hydrator/Strategy/ObjectStrategy.php @@ -2,12 +2,13 @@ namespace PlaygroundCore\Stdlib\Hydrator\Strategy; use Laminas\Hydrator\Strategy\StrategyInterface; -use DoctrineModule\Stdlib\Hydrator\Strategy\AbstractCollectionStrategy; +use Doctrine\Laminas\Hydrator\Strategy\AbstractCollectionStrategy; +use Doctrine\Laminas\Hydrator\Strategy\CollectionStrategyInterface; // This class fill a gap in Doctrine Hydrator : When the attribute is an object, we have to call getId() -class ObjectStrategy extends AbstractCollectionStrategy implements StrategyInterface +class ObjectStrategy extends AbstractCollectionStrategy implements CollectionStrategyInterface { - public function extract($value) + public function extract($value, ?object $object = null) { if (is_numeric($value) || $value === null) { return $value; @@ -16,7 +17,7 @@ public function extract($value) return $value->getId(); } - public function hydrate($value) + public function hydrate($value, ?array $data) { return $value; }