Skip to content

Commit 73f1d9e

Browse files
committed
Merge branch 'zend-to-laminas' into MC-13825
2 parents cac512f + c26fbb4 commit 73f1d9e

File tree

241 files changed

+2763
-2764
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

241 files changed

+2763
-2764
lines changed

app/code/Magento/Backend/App/Area/FrontNameResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Magento\Framework\App\RequestInterface;
1515
use Magento\Store\Model\ScopeInterface;
1616
use Magento\Store\Model\Store;
17-
use Zend\Uri\Uri;
17+
use Laminas\Uri\Uri;
1818

1919
/**
2020
* Class to get area front name.

app/code/Magento/Backend/Test/Unit/App/Area/FrontNameResolverTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class FrontNameResolverTest extends \PHPUnit\Framework\TestCase
2929
protected $scopeConfigMock;
3030

3131
/**
32-
* @var \PHPUnit_Framework_MockObject_MockObject|\Zend\Uri\Uri
32+
* @var \PHPUnit_Framework_MockObject_MockObject|\Laminas\Uri\Uri
3333
*/
3434
protected $uri;
3535

@@ -51,7 +51,7 @@ protected function setUp()
5151
->method('get')
5252
->with(ConfigOptionsList::CONFIG_PATH_BACKEND_FRONTNAME)
5353
->will($this->returnValue($this->_defaultFrontName));
54-
$this->uri = $this->createMock(\Zend\Uri\Uri::class);
54+
$this->uri = $this->createMock(\Laminas\Uri\Uri::class);
5555

5656
$this->request = $this->createMock(\Magento\Framework\App\Request\Http::class);
5757

app/code/Magento/CacheInvalidate/Model/PurgeCache.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ private function splitTags($tagsPattern)
110110
/**
111111
* Send curl purge request to servers to invalidate cache by tags pattern
112112
*
113-
* @param \Zend\Http\Client\Adapter\Socket $socketAdapter
114-
* @param \Zend\Uri\Uri[] $servers
113+
* @param \Laminas\Http\Client\Adapter\Socket $socketAdapter
114+
* @param \Laminas\Uri\Uri[] $servers
115115
* @param string $formattedTagsChunk
116116
* @return bool Return true if successful; otherwise return false
117117
*/

app/code/Magento/CacheInvalidate/Model/SocketFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
class SocketFactory
99
{
1010
/**
11-
* @return \Zend\Http\Client\Adapter\Socket
11+
* @return \Laminas\Http\Client\Adapter\Socket
1212
*/
1313
public function create()
1414
{
15-
return new \Zend\Http\Client\Adapter\Socket();
15+
return new \Laminas\Http\Client\Adapter\Socket();
1616
}
1717
}

app/code/Magento/CacheInvalidate/Test/Unit/Model/PurgeCacheTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
*/
66
namespace Magento\CacheInvalidate\Test\Unit\Model;
77

8-
use Zend\Uri\UriFactory;
8+
use Laminas\Uri\UriFactory;
99

1010
class PurgeCacheTest extends \PHPUnit\Framework\TestCase
1111
{
1212
/** @var \Magento\CacheInvalidate\Model\PurgeCache */
1313
protected $model;
1414

15-
/** @var \PHPUnit_Framework_MockObject_MockObject | \Zend\Http\Client\Adapter\Socket */
15+
/** @var \PHPUnit_Framework_MockObject_MockObject | \Laminas\Http\Client\Adapter\Socket */
1616
protected $socketAdapterMock;
1717

1818
/** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\Cache\InvalidateLogger */
@@ -24,7 +24,7 @@ class PurgeCacheTest extends \PHPUnit\Framework\TestCase
2424
protected function setUp()
2525
{
2626
$socketFactoryMock = $this->createMock(\Magento\CacheInvalidate\Model\SocketFactory::class);
27-
$this->socketAdapterMock = $this->createMock(\Zend\Http\Client\Adapter\Socket::class);
27+
$this->socketAdapterMock = $this->createMock(\Laminas\Http\Client\Adapter\Socket::class);
2828
$this->socketAdapterMock->expects($this->once())
2929
->method('setOptions')
3030
->with(['timeout' => 10]);
@@ -113,7 +113,7 @@ public function testSendPurgeRequestWithException()
113113
->method('getUris')
114114
->willReturn($uris);
115115
$this->socketAdapterMock->method('connect')
116-
->willThrowException(new \Zend\Http\Client\Adapter\Exception\RuntimeException());
116+
->willThrowException(new \Laminas\Http\Client\Adapter\Exception\RuntimeException());
117117
$this->loggerMock->expects($this->never())
118118
->method('execute');
119119
$this->loggerMock->expects($this->once())

app/code/Magento/CacheInvalidate/Test/Unit/Model/SocketFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ class SocketFactoryTest extends \PHPUnit\Framework\TestCase
1010
public function testCreate()
1111
{
1212
$factory = new \Magento\CacheInvalidate\Model\SocketFactory();
13-
$this->assertInstanceOf(\Zend\Http\Client\Adapter\Socket::class, $factory->create());
13+
$this->assertInstanceOf(\Laminas\Http\Client\Adapter\Socket::class, $factory->create());
1414
}
1515
}

app/code/Magento/Captcha/Model/DefaultModel.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
use Magento\Framework\Math\Random;
1212

1313
/**
14-
* Implementation of \Zend\Captcha\Image
14+
* Implementation of \Laminas\Captcha\Image
1515
*
1616
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
1717
*
1818
* @api
1919
* @since 100.0.2
2020
*/
21-
class DefaultModel extends \Zend\Captcha\Image implements \Magento\Captcha\Model\CaptchaInterface
21+
class DefaultModel extends \Laminas\Captcha\Image implements \Magento\Captcha\Model\CaptchaInterface
2222
{
2323
/**
2424
* Key in session for captcha code
@@ -51,7 +51,7 @@ class DefaultModel extends \Zend\Captcha\Image implements \Magento\Captcha\Model
5151
/**
5252
* Override default value to prevent a captcha cut off
5353
* @var int
54-
* @see \Zend\Captcha\Image::$fsize
54+
* @see \Laminas\Captcha\Image::$fsize
5555
* @since 100.2.0
5656
*/
5757
protected $fsize = 22;
@@ -99,7 +99,7 @@ class DefaultModel extends \Zend\Captcha\Image implements \Magento\Captcha\Model
9999
* @param ResourceModel\LogFactory $resLogFactory
100100
* @param string $formId
101101
* @param Random $randomMath
102-
* @throws \Zend\Captcha\Exception\ExtensionNotLoadedException
102+
* @throws \Laminas\Captcha\Exception\ExtensionNotLoadedException
103103
*/
104104
public function __construct(
105105
\Magento\Framework\Session\SessionManagerInterface $session,
@@ -537,7 +537,7 @@ private function clearWord()
537537
/**
538538
* Override function to generate less curly captcha that will not cut off
539539
*
540-
* @see \Zend\Captcha\Image::_randomSize()
540+
* @see \Laminas\Captcha\Image::_randomSize()
541541
* @return int
542542
* @throws \Magento\Framework\Exception\LocalizedException
543543
* @since 100.2.0

app/code/Magento/Captcha/Model/ResourceModel/Log.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function logAttempt($login)
7979
'count' => 1,
8080
'updated_at' => $this->_coreDate->gmtDate()
8181
],
82-
['count' => new \Zend\Db\Sql\Expression('count+1'), 'updated_at']
82+
['count' => new \Laminas\Db\Sql\Expression('count+1'), 'updated_at']
8383
);
8484
}
8585
$ip = $this->_remoteAddress->getRemoteAddress();
@@ -92,7 +92,7 @@ public function logAttempt($login)
9292
'count' => 1,
9393
'updated_at' => $this->_coreDate->gmtDate()
9494
],
95-
['count' => new \Zend\Db\Sql\Expression('count+1'), 'updated_at']
95+
['count' => new \Laminas\Db\Sql\Expression('count+1'), 'updated_at']
9696
);
9797
}
9898
return $this;

app/code/Magento/Captcha/composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"magento/module-checkout": "*",
1212
"magento/module-customer": "*",
1313
"magento/module-store": "*",
14-
"zendframework/zend-captcha": "^2.7.1",
15-
"zendframework/zend-db": "^2.8.2",
16-
"zendframework/zend-session": "^2.7.3"
14+
"laminas/laminas-captcha": "^2.7.1",
15+
"laminas/laminas-db": "^2.8.2",
16+
"laminas/laminas-session": "^2.7.3"
1717
},
1818
"type": "magento2-module",
1919
"license": [

app/code/Magento/Catalog/Controller/Product/Frontend/Action/Synchronize.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ public function execute()
7171
$this->synchronizer->syncActions($productsData, $typeId);
7272
} catch (\Exception $e) {
7373
$resultJson->setStatusHeader(
74-
\Zend\Http\Response::STATUS_CODE_400,
75-
\Zend\Http\AbstractMessage::VERSION_11,
74+
\Laminas\Http\Response::STATUS_CODE_400,
75+
\Laminas\Http\AbstractMessage::VERSION_11,
7676
'Bad Request'
7777
);
7878
}

app/code/Magento/Catalog/Test/Unit/Controller/Product/Frontend/Action/SynchronizeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ public function testExecuteActionException()
133133
$jsonObject->expects($this->once())
134134
->method('setStatusHeader')
135135
->with(
136-
\Zend\Http\Response::STATUS_CODE_400,
137-
\Zend\Http\AbstractMessage::VERSION_11,
136+
\Laminas\Http\Response::STATUS_CODE_400,
137+
\Laminas\Http\AbstractMessage::VERSION_11,
138138
'Bad Request'
139139
);
140140
$jsonObject->expects($this->once())

app/code/Magento/Checkout/Model/Cart/RequestQuantityProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(
3434
*/
3535
public function process(array $cartData): array
3636
{
37-
$filter = new \Zend\I18n\Filter\NumberParse($this->localeResolver->getLocale());
37+
$filter = new \Laminas\I18n\Filter\NumberParse($this->localeResolver->getLocale());
3838

3939
foreach ($cartData as $index => $data) {
4040
if (isset($data['qty'])) {

app/code/Magento/Customer/Controller/Section/Load.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ public function execute()
7878
$response = $this->sectionPool->getSectionsData($sectionNames, (bool)$forceNewSectionTimestamp);
7979
} catch (\Exception $e) {
8080
$resultJson->setStatusHeader(
81-
\Zend\Http\Response::STATUS_CODE_400,
82-
\Zend\Http\AbstractMessage::VERSION_11,
81+
\Laminas\Http\Response::STATUS_CODE_400,
82+
\Laminas\Http\AbstractMessage::VERSION_11,
8383
'Bad Request'
8484
);
8585
$response = ['message' => $this->escaper->escapeHtml($e->getMessage())];

app/code/Magento/Customer/Test/Unit/Controller/Section/LoadTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ public function testExecuteWithThrowException()
166166
$this->resultJsonMock->expects($this->once())
167167
->method('setStatusHeader')
168168
->with(
169-
\Zend\Http\Response::STATUS_CODE_400,
170-
\Zend\Http\AbstractMessage::VERSION_11,
169+
\Laminas\Http\Response::STATUS_CODE_400,
170+
\Laminas\Http\AbstractMessage::VERSION_11,
171171
'Bad Request'
172172
);
173173

app/code/Magento/Downloadable/Model/Url/DomainValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
use Magento\Downloadable\Api\DomainManagerInterface as DomainManager;
1111
use Magento\Framework\Validator\Ip as IpValidator;
12-
use Zend\Uri\Uri as UriHandler;
12+
use Laminas\Uri\Uri as UriHandler;
1313

1414
/**
1515
* Class is responsible for checking if downloadable product link domain is allowed.

app/code/Magento/Downloadable/Setup/Patch/Data/AddDownloadableHostsConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Magento\Framework\UrlInterface;
1515
use Magento\Store\Model\ScopeInterface;
1616
use Magento\Store\Model\Store;
17-
use Zend\Uri\Uri as UriHandler;
17+
use Laminas\Uri\Uri as UriHandler;
1818
use Magento\Framework\Url\ScopeResolverInterface;
1919
use Magento\Downloadable\Api\DomainManagerInterface as DomainManager;
2020
use Magento\Framework\Setup\ModuleDataSetupInterface;

app/code/Magento/Email/Model/Transport.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
use Magento\Framework\Mail\TransportInterface;
1414
use Magento\Framework\Phrase;
1515
use Magento\Store\Model\ScopeInterface;
16-
use Zend\Mail\Message;
17-
use Zend\Mail\Transport\Sendmail;
16+
use Laminas\Mail\Message;
17+
use Laminas\Mail\Transport\Sendmail;
1818

1919
/**
2020
* Class that responsible for filling some message data before transporting it.
21-
* @see \Zend\Mail\Transport\Sendmail is used for transport
21+
* @see \Laminas\Mail\Transport\Sendmail is used for transport
2222
*/
2323
class Transport implements TransportInterface
2424
{
@@ -53,7 +53,7 @@ class Transport implements TransportInterface
5353
/**
5454
* @var Sendmail
5555
*/
56-
private $zendTransport;
56+
private $laminasTransport;
5757

5858
/**
5959
* @var MessageInterface
@@ -79,7 +79,7 @@ public function __construct(
7979
ScopeInterface::SCOPE_STORE
8080
);
8181

82-
$this->zendTransport = new Sendmail($parameters);
82+
$this->laminasTransport = new Sendmail($parameters);
8383
$this->message = $message;
8484
}
8585

@@ -89,16 +89,16 @@ public function __construct(
8989
public function sendMessage()
9090
{
9191
try {
92-
$zendMessage = Message::fromString($this->message->getRawMessage())->setEncoding('utf-8');
92+
$laminasMessage = Message::fromString($this->message->getRawMessage())->setEncoding('utf-8');
9393
if (2 === $this->isSetReturnPath && $this->returnPathValue) {
94-
$zendMessage->setSender($this->returnPathValue);
95-
} elseif (1 === $this->isSetReturnPath && $zendMessage->getFrom()->count()) {
96-
$fromAddressList = $zendMessage->getFrom();
94+
$laminasMessage->setSender($this->returnPathValue);
95+
} elseif (1 === $this->isSetReturnPath && $laminasMessage->getFrom()->count()) {
96+
$fromAddressList = $laminasMessage->getFrom();
9797
$fromAddressList->rewind();
98-
$zendMessage->setSender($fromAddressList->current()->getEmail());
98+
$laminasMessage->setSender($fromAddressList->current()->getEmail());
9999
}
100100

101-
$this->zendTransport->send($zendMessage);
101+
$this->laminasTransport->send($laminasMessage);
102102
} catch (\Exception $e) {
103103
throw new MailException(new Phrase($e->getMessage()), $e);
104104
}

app/code/Magento/Integration/Test/Unit/Model/Oauth/ConsumerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace Magento\Integration\Test\Unit\Model\Oauth;
77

88
use Magento\Framework\Url\Validator as UrlValidator;
9-
use Zend\Validator\Uri as ZendUriValidator;
9+
use Laminas\Validator\Uri as LaminasUriValidator;
1010
use Magento\Integration\Model\Oauth\Consumer\Validator\KeyLength;
1111

1212
/**
@@ -85,7 +85,7 @@ protected function setUp()
8585

8686
$this->keyLengthValidator = new KeyLength();
8787

88-
$this->urlValidator = new UrlValidator(new ZendUriValidator());
88+
$this->urlValidator = new UrlValidator(new LaminasUriValidator());
8989

9090
$this->oauthDataMock = $this->createPartialMock(
9191
\Magento\Integration\Helper\Oauth\Data::class,

app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdExceptionDuringMediaAssetInitializationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Magento\MediaGalleryApi\Api\Data\AssetInterfaceFactory;
1717
use PHPUnit\Framework\MockObject\MockObject;
1818
use Psr\Log\LoggerInterface;
19-
use Zend\Db\Adapter\Driver\Pdo\Statement;
19+
use Laminas\Db\Adapter\Driver\Pdo\Statement;
2020

2121
/**
2222
* Test the GetById command with exception during media asset initialization

app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdExceptionNoSuchEntityTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Magento\MediaGalleryApi\Api\Data\AssetInterfaceFactory;
1717
use PHPUnit\Framework\MockObject\MockObject;
1818
use Psr\Log\LoggerInterface;
19-
use Zend\Db\Adapter\Driver\Pdo\Statement;
19+
use Laminas\Db\Adapter\Driver\Pdo\Statement;
2020

2121
/**
2222
* Test the GetById command with exception thrown in case when there is no such entity

app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdExceptionOnGetDataTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Magento\MediaGalleryApi\Api\Data\AssetInterfaceFactory;
1717
use PHPUnit\Framework\MockObject\MockObject;
1818
use Psr\Log\LoggerInterface;
19-
use Zend\Db\Adapter\Driver\Pdo\Statement;
19+
use Laminas\Db\Adapter\Driver\Pdo\Statement;
2020

2121
/**
2222
* Test the GetById command with exception during get media data

app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdSuccessfulTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Magento\MediaGalleryApi\Api\Data\AssetInterfaceFactory;
1717
use PHPUnit\Framework\MockObject\MockObject;
1818
use Psr\Log\LoggerInterface;
19-
use Zend\Db\Adapter\Driver\Pdo\Statement;
19+
use Laminas\Db\Adapter\Driver\Pdo\Statement;
2020

2121
/**
2222
* Test the GetById command successful scenario

app/code/Magento/MediaStorage/Test/Unit/Model/File/Storage/ResponseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected function setUp()
4747
public function testSendResponse(): void
4848
{
4949
$filePath = 'file_path';
50-
$headers = $this->getMockBuilder(\Zend\Http\Headers::class)->getMock();
50+
$headers = $this->getMockBuilder(\Laminas\Http\Headers::class)->getMock();
5151
$this->response->setFilePath($filePath);
5252
$this->response->setHeaders($headers);
5353
$this->transferAdapter

app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function aroundDispatch(
9090
protected function addDebugHeaders(ResponseHttp $result)
9191
{
9292
$cacheControlHeader = $result->getHeader('Cache-Control');
93-
if ($cacheControlHeader instanceof \Zend\Http\Header\HeaderInterface) {
93+
if ($cacheControlHeader instanceof \Laminas\Http\Header\HeaderInterface) {
9494
$this->addDebugHeader($result, 'X-Magento-Cache-Control', $cacheControlHeader->getFieldValue());
9595
}
9696
$this->addDebugHeader($result, 'X-Magento-Cache-Debug', 'MISS', true);

app/code/Magento/PageCache/Model/Cache/Server.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
use Magento\Framework\App\DeploymentConfig;
1010
use Magento\Framework\Config\ConfigOptionsListConstants;
1111
use Magento\Framework\App\RequestInterface;
12-
use Zend\Uri\Uri;
13-
use Zend\Uri\UriFactory;
12+
use Laminas\Uri\Uri;
13+
use Laminas\Uri\UriFactory;
1414

1515
/**
1616
* Cache server model.

app/code/Magento/PageCache/Model/Controller/Result/BuiltinPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Magento\Framework\Registry;
1212
use Magento\Framework\Controller\ResultInterface;
1313
use Magento\Framework\App\Response\Http as ResponseHttp;
14-
use Zend\Http\Header\HeaderInterface as HttpHeaderInterface;
14+
use Laminas\Http\Header\HeaderInterface as HttpHeaderInterface;
1515
use Magento\PageCache\Model\Cache\Type as CacheType;
1616

1717
/**

app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/BuiltinPluginTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ protected function setUp()
8484
*/
8585
public function testAroundDispatchProcessIfCacheMissed($state)
8686
{
87-
$header = \Zend\Http\Header\GenericHeader::fromString('Cache-Control: no-cache');
87+
$header = \Laminas\Http\Header\GenericHeader::fromString('Cache-Control: no-cache');
8888
$this->configMock
8989
->expects($this->once())
9090
->method('getType')

0 commit comments

Comments
 (0)