Skip to content

Commit ae47540

Browse files
committed
ECP-261: Offload Catalog Image Resizing from Magento
- Fixed tests - Suppressed excessive coupling warning in Helper/Image because it is an @api class with dependencies in protected properties (cannot be refactored in backward compatible manner)
1 parent db1dc09 commit ae47540

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

app/code/Magento/Catalog/Helper/Image.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
use Magento\Framework\View\Element\Block\ArgumentInterface;
1414

1515
/**
16-
* Catalog image helper
16+
* Catalog image helper.
1717
*
1818
* @api
1919
* @SuppressWarnings(PHPMD.TooManyFields)
20+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2021
* @since 100.0.2
2122
*/
2223
class Image extends AbstractHelper implements ArgumentInterface
@@ -163,8 +164,7 @@ public function __construct(
163164
$this->_assetRepo = $assetRepo;
164165
$this->viewConfig = $viewConfig;
165166
$this->viewAssetPlaceholderFactory = $placeholderFactory
166-
?: ObjectManager::getInstance()
167-
->get(PlaceholderFactory::class);
167+
?: ObjectManager::getInstance()->get(PlaceholderFactory::class);
168168
$this->mediaConfig = $mediaConfig ?: ObjectManager::getInstance()->get(CatalogMediaConfig::class);
169169
}
170170

@@ -394,9 +394,10 @@ public function constrainOnly($flag)
394394
*/
395395
public function backgroundColor($colorRGB)
396396
{
397+
$args = func_get_args();
397398
// assume that 3 params were given instead of array
398399
if (!is_array($colorRGB)) {
399-
$colorRGB = func_get_args();
400+
$colorRGB = $args;
400401
}
401402
$this->_getModel()->setBackgroundColor($colorRGB);
402403
return $this;

app/code/Magento/MediaStorage/Console/Command/ImagesResizeCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ protected function configure()
8686
$this->setName('catalog:images:resize')
8787
->setDescription(
8888
'Creates resized product images ' .
89-
'(Not relevant when image resizing is offloaded from Magento. See https://docs.magento.com/m2/ee/user_guide/configuration/general/web.html#url-options )'
89+
'(Not relevant when image resizing is offloaded from Magento. ' .
90+
'See https://docs.magento.com/m2/ee/user_guide/configuration/general/web.html#url-options )'
9091
)
9192
->setDefinition($this->getOptionsList());
9293
}

app/code/Magento/Store/Test/Unit/Model/HeaderProvider/UpgradeInsecureTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class UpgradeInsecureTest extends \PHPUnit\Framework\TestCase
1919
/**
2020
* Content-Security-Policy header value
2121
*/
22-
const HEADER_VALUE = 'upgrade-insecure-requests;';
22+
const HEADER_VALUE = 'upgrade-insecure-requests';
2323

2424
/**
2525
* @var UpgradeInsecure

0 commit comments

Comments
 (0)