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

#31346 :- Update laminas/laminas-servicemanager #32234

Closed
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
laminas-servicemanager updated to 3.5.1
  • Loading branch information
konarshankar07 committed Feb 21, 2021
commit 06d3ade50c1492c50e0dcc7e2c8371bc8b18548a
13 changes: 7 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"colinmollenhour/credis": "1.11.1",
"colinmollenhour/php-redis-session-abstract": "~1.4.0",
"composer/composer": "^1.9 || ^2.0",
"magento/magento-composer-installer": ">=0.1.11",
"elasticsearch/elasticsearch": "~7.11.0",
"guzzlehttp/guzzle": "^6.3.3",
"laminas/laminas-captcha": "^2.7.1",
Expand All @@ -56,15 +55,20 @@
"laminas/laminas-mvc": "~2.7.0",
"laminas/laminas-serializer": "^2.7.2",
"laminas/laminas-server": "^2.6.1",
"laminas/laminas-servicemanager": "^2.7.8",
"laminas/laminas-servicemanager": "^3.5.1",
Copy link
Contributor

@Den4ik Den4ik Mar 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on release notes https://github.com/laminas/laminas-servicemanager/releases php 8 support added from 3.6.0

"laminas/laminas-servicemanager-di": "^1.2",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that laminas-servicemanager-di archived and is not required https://github.com/laminas/laminas-servicemanager-di

You can now use laminas/laminas-di directly with laminas/laminas-servicemanager.

"laminas/laminas-session": "^2.7.3",
"laminas/laminas-soap": "^2.7.0",
"laminas/laminas-stdlib": "^3.2.1",
"laminas/laminas-text": "^2.6.0",
"laminas/laminas-uri": "^2.5.1",
"laminas/laminas-validator": "^2.6.0",
"laminas/laminas-view": "~2.11.2",
"league/flysystem": "^1.0",
"league/flysystem-aws-s3-v3": "^1.0",
"league/flysystem-cached-adapter": "^1.0",
"magento/composer": "1.6.0",
"magento/magento-composer-installer": ">=0.1.11",
"magento/zendframework1": "~1.14.2",
"monolog/monolog": "^1.17",
"paragonie/sodium_compat": "^1.6",
Expand All @@ -79,10 +83,7 @@
"tedivm/jshrink": "~1.4.0",
"tubalmartin/cssmin": "4.1.1",
"webonyx/graphql-php": "^0.13.8",
"wikimedia/less.php": "^3.0.0",
"league/flysystem": "^1.0",
"league/flysystem-aws-s3-v3": "^1.0",
"league/flysystem-cached-adapter": "^1.0"
"wikimedia/less.php": "^3.0.0"
},
"require-dev": {
"allure-framework/allure-phpunit": "~1.2.0",
Expand Down
128 changes: 106 additions & 22 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion setup/config/application.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

use Magento\Setup\Mvc\Bootstrap\InitParamListener;
use Laminas\Mvc\Service\DiAbstractServiceFactoryFactory;
use Laminas\ServiceManager\Di\DiAbstractServiceFactoryFactory;
use Laminas\ServiceManager\Di\DiAbstractServiceFactory;
Comment on lines +8 to 9
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
use Laminas\ServiceManager\Di\DiAbstractServiceFactoryFactory;
use Laminas\ServiceManager\Di\DiAbstractServiceFactory;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on documentation for lamins-servicemanager since v.3.0.0 laminas/laminas-servicemanager-di is not required and factories map could be removed from line

DiAbstractServiceFactory::class => DiAbstractServiceFactoryFactory::class,
too


return [
Expand Down
46 changes: 22 additions & 24 deletions setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,23 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Setup\Mvc\Bootstrap;

use Magento\Framework\App\Bootstrap as AppBootstrap;
use Magento\Framework\App\Filesystem\DirectoryList;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\App\Request\Http;
use Magento\Framework\App\State;
use Magento\Framework\Filesystem;
use Magento\Framework\Shell\ComplexParameter;
use Interop\Container\ContainerInterface;
use Laminas\Console\Request;
use Laminas\EventManager\EventManagerInterface;
use Laminas\EventManager\ListenerAggregateInterface;
use Laminas\Mvc\Application;
use Laminas\Mvc\MvcEvent;
use Laminas\Router\Http\RouteMatch;
use Laminas\ServiceManager\FactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
use Laminas\ServiceManager\Factory\FactoryInterface;
use Laminas\Stdlib\RequestInterface;
use Laminas\Uri\UriInterface;
use Magento\Framework\App\Bootstrap as AppBootstrap;
use Magento\Framework\App\Filesystem\DirectoryList;
use Magento\Framework\App\State;
use Magento\Framework\Filesystem;
use Magento\Framework\Shell\ComplexParameter;

/**
* A listener that injects relevant Magento initialization parameters and initializes filesystem
Expand Down Expand Up @@ -52,7 +50,7 @@ class InitParamListener implements ListenerAggregateInterface, FactoryInterface
* @param int $priority
* @return void
*/
public function attach(EventManagerInterface $events, $priority = 1)
public function attach(EventManagerInterface $events, $priority = 1): void
{
$sharedEvents = $events->getSharedManager();
$sharedEvents->attach(
Expand All @@ -71,7 +69,7 @@ public function attach(EventManagerInterface $events, $priority = 1)
* @param EventManagerInterface $events
* @return void
*/
public function detach(EventManagerInterface $events)
public function detach(EventManagerInterface $events): void
{
foreach ($this->listeners as $index => $listener) {
$events->detach($listener);
Expand All @@ -85,7 +83,7 @@ public function detach(EventManagerInterface $events)
* @param MvcEvent $e
* @return void
*/
public function onBootstrap(MvcEvent $e)
public function onBootstrap(MvcEvent $e): void
{
/** @var Application $application */
$application = $e->getApplication();
Expand All @@ -97,14 +95,14 @@ public function onBootstrap(MvcEvent $e)
}

/**
* @inheritdoc
*
* @param ServiceLocatorInterface $serviceLocator
* @return mixed
* @param ContainerInterface $container
* @param string $requestedName
* @param array|null $options
* @return array|object
*/
public function createService(ServiceLocatorInterface $serviceLocator)
public function __invoke(ContainerInterface $container, $requestedName, array $options = null): object
{
return $this->extractInitParameters($serviceLocator->get('Application'));
return $this->extractInitParameters($container->get('Application'));
}

/**
Expand All @@ -118,7 +116,7 @@ public function createService(ServiceLocatorInterface $serviceLocator)
* @param Application $application
* @return array
*/
private function extractInitParameters(Application $application)
private function extractInitParameters(Application $application): array
{
$result = [];
$config = $application->getConfig();
Expand All @@ -142,7 +140,7 @@ private function extractInitParameters(Application $application)
* @param RequestInterface $request
* @return array
*/
private function extractFromCli(RequestInterface $request)
private function extractFromCli(RequestInterface $request): array
{
if (!($request instanceof Request)) {
return [];
Expand All @@ -164,7 +162,7 @@ private function extractFromCli(RequestInterface $request)
* @return DirectoryList
* @throws \LogicException
*/
public function createDirectoryList($initParams)
public function createDirectoryList($initParams): DirectoryList
{
if (!isset($initParams[AppBootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS][DirectoryList::ROOT])) {
throw new \LogicException('Magento root directory is not specified.');
Expand All @@ -180,7 +178,7 @@ public function createDirectoryList($initParams)
* @param DirectoryList $directoryList
* @return Filesystem
*/
public function createFilesystem(DirectoryList $directoryList)
public function createFilesystem(DirectoryList $directoryList): Filesystem
{
$driverPool = new Filesystem\DriverPool();
return new Filesystem(
Expand Down