Skip to content

Commit e314678

Browse files
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #14028: [FIX] small refactoring and removing not using variable from templates (by @coderimus) - #13977: Backport of PR-10748 for Magento 2.2: Always use https for Vimeo vide� (by @hostep) - #11376: [Backport 2.2-develop] PHP Livecodetest testCodeStyle() method does not use whitelist files (by @adrian-martinez-interactiv4)
2 parents 3f053dd + 4597893 commit e314678

File tree

8 files changed

+16
-11
lines changed

8 files changed

+16
-11
lines changed

app/code/Magento/Catalog/view/base/templates/product/price/default.phtml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
<?php
1212
/** @var \Magento\Catalog\Pricing\Render\FinalPriceBox $block */
1313

14-
$productId = $block->getSaleableItem()->getId();
15-
1614
/** ex: \Magento\Catalog\Pricing\Price\RegularPrice */
1715
/** @var \Magento\Framework\Pricing\Price\PriceInterface $priceModel */
1816
$priceModel = $block->getPriceType('regular_price');

app/code/Magento/Catalog/view/base/templates/product/price/final_price.phtml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
<?php
1212
/** @var \Magento\Catalog\Pricing\Render\FinalPriceBox $block */
1313

14-
$productId = $block->getSaleableItem()->getId();
15-
1614
/** ex: \Magento\Catalog\Pricing\Price\RegularPrice */
1715
/** @var \Magento\Framework\Pricing\Price\PriceInterface $priceModel */
1816
$priceModel = $block->getPriceType('regular_price');

app/code/Magento/ProductVideo/view/adminhtml/web/js/get-video-information.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ define([
302302
additionalParams += '&autoplay=1';
303303
}
304304

305-
src = window.location.protocol + '//player.vimeo.com/video/' +
305+
src = 'https://player.vimeo.com/video/' +
306306
this._code + '?api=1&player_id=vimeo' +
307307
this._code +
308308
timestamp +
@@ -525,7 +525,7 @@ define([
525525
);
526526
} else if (type === 'vimeo') {
527527
$.ajax({
528-
url: window.location.protocol + '//www.vimeo.com/api/v2/video/' + id + '.json',
528+
url: 'https://www.vimeo.com/api/v2/video/' + id + '.json',
529529
dataType: 'jsonp',
530530
data: {
531531
format: 'json'

app/code/Magento/ProductVideo/view/frontend/web/js/load-player.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ define(['jquery', 'jquery/ui'], function ($) {
317317
if (this._loop) {
318318
additionalParams += '&loop=1';
319319
}
320-
src = window.location.protocol + '//player.vimeo.com/video/' +
320+
src = 'https://player.vimeo.com/video/' +
321321
this._code + '?api=1&player_id=vimeo' +
322322
this._code +
323323
timestamp +

app/code/Magento/Sales/view/adminhtml/templates/order/view/info.phtml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ $orderStoreDate = $block->formatDate(
2424
true,
2525
$block->getTimezoneForStore($order->getStore())
2626
);
27+
28+
$customerUrl = $block->getCustomerViewUrl();
2729
?>
2830

2931
<section class="admin__page-section order-view-account-information">
@@ -114,8 +116,8 @@ $orderStoreDate = $block->formatDate(
114116
<div class="admin__page-section-item-title">
115117
<span class="title"><?= $block->escapeHtml(__('Account Information')) ?></span>
116118
<div class="actions">
117-
<?php if ($customerUrl = $block->getCustomerViewUrl()) : ?>
118-
<a href="<?= /* @noEscape */ $block->getCustomerViewUrl() ?>" target="_blank">
119+
<?php if ($customerUrl) : ?>
120+
<a href="<?= /* @noEscape */ $customerUrl ?>" target="_blank">
119121
<?= $block->escapeHtml(__('Edit Customer')) ?>
120122
</a>
121123
<?php endif; ?>
@@ -126,7 +128,7 @@ $orderStoreDate = $block->formatDate(
126128
<tr>
127129
<th><?= $block->escapeHtml(__('Customer Name')) ?></th>
128130
<td>
129-
<?php if ($customerUrl = $block->getCustomerViewUrl()): ?>
131+
<?php if ($customerUrl): ?>
130132
<a href="<?= $block->escapeUrl($customerUrl) ?>" target="_blank">
131133
<span><?= $block->escapeHtml($order->getCustomerName()) ?></span>
132134
</a>

dev/tests/static/phpunit-all.xml.dist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,7 @@
1919
</testsuites>
2020
<php>
2121
<ini name="date.timezone" value="America/Los_Angeles"/>
22+
<!-- TESTCODESTYLE_IS_FULL_SCAN - specify if full scan should be performed for test code style test -->
23+
<const name="TESTCODESTYLE_IS_FULL_SCAN" value="1"/>
2224
</php>
2325
</phpunit>

dev/tests/static/phpunit.xml.dist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
</testsuites>
3030
<php>
3131
<ini name="date.timezone" value="America/Los_Angeles"/>
32+
<!-- TESTCODESTYLE_IS_FULL_SCAN - specify if full scan should be performed for test code style test -->
33+
<const name="TESTCODESTYLE_IS_FULL_SCAN" value="1"/>
3234
<!-- TESTS_COMPOSER_PATH - specify the path to composer binary, if a relative reference cannot be resolved -->
3335
<!--<const name="TESTS_COMPOSER_PATH" value="/usr/local/bin/composer"/>-->
3436
</php>

dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,14 @@ private function getFullWhitelist()
201201

202202
public function testCodeStyle()
203203
{
204+
$whiteList = defined('TESTCODESTYLE_IS_FULL_SCAN') && TESTCODESTYLE_IS_FULL_SCAN === '1'
205+
? $this->getFullWhitelist() : self::getWhitelist(['php', 'phtml']);
206+
204207
$reportFile = self::$reportDir . '/phpcs_report.txt';
205208
$codeSniffer = new CodeSniffer('Magento', $reportFile, new Wrapper());
206209
$this->assertEquals(
207210
0,
208-
$result = $codeSniffer->run($this->getFullWhitelist()),
211+
$result = $codeSniffer->run($whiteList),
209212
"PHP Code Sniffer detected {$result} violation(s): " . PHP_EOL . file_get_contents($reportFile)
210213
);
211214
}

0 commit comments

Comments
 (0)