Skip to content

Commit ec609e3

Browse files
committed
Migrate ZF2 components to Laminas components
1 parent dbf2d34 commit ec609e3

File tree

246 files changed

+5263
-5012
lines changed

Some content is hidden

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

246 files changed

+5263
-5012
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
}

0 commit comments

Comments
 (0)