Skip to content

Commit fc7fb0d

Browse files
authored
Merge pull request magento#4488 from magento-techdivision/php73_update
[Techdivision] Add PHP 7.3 support
2 parents 65cdb4c + 23bd6d3 commit fc7fb0d

File tree

235 files changed

+1105
-725
lines changed

Some content is hidden

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

235 files changed

+1105
-725
lines changed

app/code/Magento/AdminNotification/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "~7.1.3||~7.2.0",
8+
"php": "~7.1.3||~7.2.0||~7.3.0",
99
"lib-libxml": "*",
1010
"magento/framework": "*",
1111
"magento/module-backend": "*",

app/code/Magento/AdvancedPricingImportExport/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "~7.1.3||~7.2.0",
8+
"php": "~7.1.3||~7.2.0||~7.3.0",
99
"magento/framework": "*",
1010
"magento/module-catalog": "*",
1111
"magento/module-catalog-import-export": "*",

app/code/Magento/AdvancedSearch/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"magento/module-customer": "*",
1414
"magento/module-search": "*",
1515
"magento/module-store": "*",
16-
"php": "~7.1.3||~7.2.0"
16+
"php": "~7.1.3||~7.2.0||~7.3.0"
1717
},
1818
"type": "magento2-module",
1919
"license": [

app/code/Magento/Amqp/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"magento/framework": "*",
99
"magento/framework-amqp": "*",
1010
"magento/framework-message-queue": "*",
11-
"php": "~7.1.3||~7.2.0"
11+
"php": "~7.1.3||~7.2.0||~7.3.0"
1212
},
1313
"type": "magento2-module",
1414
"license": [

app/code/Magento/AmqpStore/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"magento/framework": "*",
99
"magento/framework-amqp": "*",
1010
"magento/module-store": "*",
11-
"php": "~7.1.3||~7.2.0"
11+
"php": "~7.1.3||~7.2.0||~7.3.0"
1212
},
1313
"suggest": {
1414
"magento/module-asynchronous-operations": "*",

app/code/Magento/Analytics/Model/Connector/Http/ResponseResolver.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ public function __construct(ConverterInterface $converter, array $responseHandle
3131
}
3232

3333
/**
34-
* @param \Zend_Http_Response $response
34+
* Get result from $response.
3535
*
36+
* @param \Zend_Http_Response $response
3637
* @return bool|string
3738
*/
3839
public function getResult(\Zend_Http_Response $response)
@@ -41,7 +42,8 @@ public function getResult(\Zend_Http_Response $response)
4142
$converterMediaType = $this->converter->getContentMediaType();
4243

4344
/** Content-Type header may not only contain media-type declaration */
44-
if ($response->getBody() && is_int(strripos($response->getHeader('Content-Type'), $converterMediaType))) {
45+
if ($response->getBody()
46+
&& is_int(strripos($response->getHeader('Content-Type'), (string) $converterMediaType))) {
4547
$responseBody = $this->converter->fromBody($response->getBody());
4648
} else {
4749
$responseBody = [];

app/code/Magento/Analytics/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-analytics",
33
"description": "N/A",
44
"require": {
5-
"php": "~7.1.3||~7.2.0",
5+
"php": "~7.1.3||~7.2.0||~7.3.0",
66
"magento/module-backend": "*",
77
"magento/module-config": "*",
88
"magento/module-integration": "*",

app/code/Magento/AsynchronousOperations/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"magento/module-authorization": "*",
1111
"magento/module-backend": "*",
1212
"magento/module-ui": "*",
13-
"php": "~7.1.3||~7.2.0"
13+
"php": "~7.1.3||~7.2.0||~7.3.0"
1414
},
1515
"suggest": {
1616
"magento/module-admin-notification": "*",

app/code/Magento/Authorization/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "~7.1.3||~7.2.0",
8+
"php": "~7.1.3||~7.2.0||~7.3.0",
99
"magento/framework": "*",
1010
"magento/module-backend": "*"
1111
},

app/code/Magento/Authorizenet/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "~7.1.3||~7.2.0",
8+
"php": "~7.1.3||~7.2.0||~7.3.0",
99
"magento/framework": "*",
1010
"magento/module-backend": "*",
1111
"magento/module-catalog": "*",

app/code/Magento/AuthorizenetAcceptjs/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "~7.1.3||~7.2.0",
8+
"php": "~7.1.3||~7.2.0||~7.3.0",
99
"magento/framework": "*",
1010
"magento/module-payment": "*",
1111
"magento/module-sales": "*",

app/code/Magento/AuthorizenetCardinal/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "~7.1.3||~7.2.0",
8+
"php": "~7.1.3||~7.2.0||~7.3.0",
99
"magento/module-authorizenet-acceptjs": "*",
1010
"magento/framework": "*",
1111
"magento/module-cardinal-commerce": "*",

app/code/Magento/AuthorizenetGraphQl/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "N/A",
44
"type": "magento2-module",
55
"require": {
6-
"php": "~7.1.3||~7.2.0",
6+
"php": "~7.1.3||~7.2.0||~7.3.0",
77
"magento/framework": "*",
88
"magento/module-quote-graph-ql": "*"
99
},

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

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,15 @@
1010
use Magento\Backend\Setup\ConfigOptionsList;
1111
use Magento\Framework\App\Config\ScopeConfigInterface;
1212
use Magento\Framework\App\DeploymentConfig;
13+
use Magento\Framework\App\ObjectManager;
14+
use Magento\Framework\App\RequestInterface;
1315
use Magento\Store\Model\ScopeInterface;
1416
use Magento\Store\Model\Store;
17+
use Zend\Uri\Uri;
1518

1619
/**
20+
* Class to get area front name.
21+
*
1722
* @api
1823
* @since 100.0.2
1924
*/
@@ -59,19 +64,35 @@ class FrontNameResolver implements \Magento\Framework\App\Area\FrontNameResolver
5964
*/
6065
private $scopeConfig;
6166

67+
/**
68+
* @var Uri
69+
*/
70+
private $uri;
71+
72+
/**
73+
* @var RequestInterface
74+
*/
75+
private $request;
76+
6277
/**
6378
* @param \Magento\Backend\App\Config $config
6479
* @param DeploymentConfig $deploymentConfig
6580
* @param ScopeConfigInterface $scopeConfig
81+
* @param Uri $uri
82+
* @param RequestInterface $request
6683
*/
6784
public function __construct(
6885
\Magento\Backend\App\Config $config,
6986
DeploymentConfig $deploymentConfig,
70-
ScopeConfigInterface $scopeConfig
87+
ScopeConfigInterface $scopeConfig,
88+
Uri $uri = null,
89+
RequestInterface $request = null
7190
) {
7291
$this->config = $config;
7392
$this->defaultFrontName = $deploymentConfig->get(ConfigOptionsList::CONFIG_PATH_BACKEND_FRONTNAME);
7493
$this->scopeConfig = $scopeConfig;
94+
$this->uri = $uri ?: ObjectManager::getInstance()->get(Uri::class);
95+
$this->request = $request ?: ObjectManager::getInstance()->get(RequestInterface::class);
7596
}
7697

7798
/**
@@ -104,8 +125,8 @@ public function isHostBackend()
104125
} else {
105126
$backendUrl = $this->scopeConfig->getValue(Store::XML_PATH_UNSECURE_BASE_URL, ScopeInterface::SCOPE_STORE);
106127
}
107-
$host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
108-
return stripos($this->getHostWithPort($backendUrl), $host) !== false;
128+
$host = $this->request->getServer('HTTP_HOST', '');
129+
return stripos($this->getHostWithPort($backendUrl), (string) $host) !== false;
109130
}
110131

111132
/**
@@ -116,9 +137,11 @@ public function isHostBackend()
116137
*/
117138
private function getHostWithPort($url)
118139
{
119-
$scheme = parse_url(trim($url), PHP_URL_SCHEME);
120-
$host = parse_url(trim($url), PHP_URL_HOST);
121-
$port = parse_url(trim($url), PHP_URL_PORT);
140+
$this->uri->parse($url);
141+
$scheme = $this->uri->getScheme();
142+
$host = $this->uri->getHost();
143+
$port = $this->uri->getPort();
144+
122145
if (!$port) {
123146
$port = isset($this->standardPorts[$scheme]) ? $this->standardPorts[$scheme] : null;
124147
}

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

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ class FrontNameResolverTest extends \PHPUnit\Framework\TestCase
2828
*/
2929
protected $scopeConfigMock;
3030

31+
/**
32+
* @var \PHPUnit_Framework_MockObject_MockObject|\Zend\Uri\Uri
33+
*/
34+
protected $uri;
35+
36+
/**
37+
* @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\Request\Http
38+
*/
39+
protected $request;
40+
3141
/**
3242
* @var string
3343
*/
@@ -41,9 +51,19 @@ protected function setUp()
4151
->method('get')
4252
->with(ConfigOptionsList::CONFIG_PATH_BACKEND_FRONTNAME)
4353
->will($this->returnValue($this->_defaultFrontName));
54+
$this->uri = $this->createMock(\Zend\Uri\Uri::class);
55+
56+
$this->request = $this->createMock(\Magento\Framework\App\Request\Http::class);
57+
4458
$this->configMock = $this->createMock(\Magento\Backend\App\Config::class);
4559
$this->scopeConfigMock = $this->createMock(\Magento\Framework\App\Config\ScopeConfigInterface::class);
46-
$this->model = new FrontNameResolver($this->configMock, $deploymentConfigMock, $this->scopeConfigMock);
60+
$this->model = new FrontNameResolver(
61+
$this->configMock,
62+
$deploymentConfigMock,
63+
$this->scopeConfigMock,
64+
$this->uri,
65+
$this->request
66+
);
4767
}
4868

4969
public function testIfCustomPathUsed()
@@ -93,7 +113,6 @@ public function testIfCustomPathNotUsed()
93113
*/
94114
public function testIsHostBackend($url, $host, $useCustomAdminUrl, $customAdminUrl, $expectedValue)
95115
{
96-
$_SERVER['HTTP_HOST'] = $host;
97116
$this->scopeConfigMock->expects($this->exactly(2))
98117
->method('getValue')
99118
->will(
@@ -115,6 +134,41 @@ public function testIsHostBackend($url, $host, $useCustomAdminUrl, $customAdminU
115134
]
116135
)
117136
);
137+
138+
$this->request->expects($this->any())
139+
->method('getServer')
140+
->will($this->returnValue($host));
141+
142+
$urlParts = [];
143+
$this->uri->expects($this->once())
144+
->method('parse')
145+
->willReturnCallback(
146+
function ($url) use (&$urlParts) {
147+
$urlParts = parse_url($url);
148+
}
149+
);
150+
$this->uri->expects($this->once())
151+
->method('getScheme')
152+
->willReturnCallback(
153+
function () use (&$urlParts) {
154+
return array_key_exists('scheme', $urlParts) ? $urlParts['scheme'] : '';
155+
}
156+
);
157+
$this->uri->expects($this->once())
158+
->method('getHost')
159+
->willReturnCallback(
160+
function () use (&$urlParts) {
161+
return array_key_exists('host', $urlParts) ? $urlParts['host'] : '';
162+
}
163+
);
164+
$this->uri->expects($this->once())
165+
->method('getPort')
166+
->willReturnCallback(
167+
function () use (&$urlParts) {
168+
return array_key_exists('port', $urlParts) ? $urlParts['port'] : '';
169+
}
170+
);
171+
118172
$this->assertEquals($this->model->isHostBackend(), $expectedValue);
119173
}
120174

app/code/Magento/Backend/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "~7.1.3||~7.2.0",
8+
"php": "~7.1.3||~7.2.0||~7.3.0",
99
"magento/framework": "*",
1010
"magento/module-backup": "*",
1111
"magento/module-catalog": "*",

app/code/Magento/Backup/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "~7.1.3||~7.2.0",
8+
"php": "~7.1.3||~7.2.0||~7.3.0",
99
"magento/framework": "*",
1010
"magento/module-backend": "*",
1111
"magento/module-cron": "*",

app/code/Magento/Braintree/Model/LocaleResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function getLocale()
8787
$locale = $this->localeMap[$this->resolver->getLocale()] ?? $this->resolver->getLocale();
8888
$allowedLocales = $this->config->getValue('supported_locales');
8989

90-
return strpos($allowedLocales, $locale) !== false ? $locale : 'en_US';
90+
return strpos($allowedLocales, (string) $locale) !== false ? $locale : 'en_US';
9191
}
9292

9393
/**

app/code/Magento/Braintree/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "~7.1.3||~7.2.0",
8+
"php": "~7.1.3||~7.2.0||~7.3.0",
99
"braintree/braintree_php": "3.35.0",
1010
"magento/framework": "*",
1111
"magento/magento-composer-installer": "*",

app/code/Magento/Bundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "~7.1.3||~7.2.0",
8+
"php": "~7.1.3||~7.2.0||~7.3.0",
99
"magento/framework": "*",
1010
"magento/module-backend": "*",
1111
"magento/module-catalog": "*",

app/code/Magento/BundleGraphQl/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "N/A",
44
"type": "magento2-module",
55
"require": {
6-
"php": "~7.1.3||~7.2.0",
6+
"php": "~7.1.3||~7.2.0||~7.3.0",
77
"magento/module-catalog": "*",
88
"magento/module-bundle": "*",
99
"magento/module-catalog-graph-ql": "*",

app/code/Magento/BundleImportExport/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "~7.1.3||~7.2.0",
8+
"php": "~7.1.3||~7.2.0||~7.3.0",
99
"magento/framework": "*",
1010
"magento/module-bundle": "*",
1111
"magento/module-store": "*",

app/code/Magento/CacheInvalidate/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "~7.1.3||~7.2.0",
8+
"php": "~7.1.3||~7.2.0||~7.3.0",
99
"magento/framework": "*",
1010
"magento/module-page-cache": "*"
1111
},

app/code/Magento/Captcha/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "~7.1.3||~7.2.0",
8+
"php": "~7.1.3||~7.2.0||~7.3.0",
99
"magento/framework": "*",
1010
"magento/module-backend": "*",
1111
"magento/module-checkout": "*",

app/code/Magento/CardinalCommerce/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "~7.1.3||~7.2.0",
8+
"php": "~7.1.3||~7.2.0||~7.3.0",
99
"magento/framework": "*",
1010
"magento/module-checkout": "*",
1111
"magento/module-payment": "*",

0 commit comments

Comments
 (0)