Skip to content

Commit 04cbbad

Browse files
committed
ACP2E-517: fix static test warnings
1 parent 4a60f52 commit 04cbbad

File tree

1 file changed

+10
-5
lines changed
  • app/code/Magento/Deploy/Package/Processor/PreProcessor

1 file changed

+10
-5
lines changed

app/code/Magento/Deploy/Package/Processor/PreProcessor/Less.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Deploy\Package\Processor\PreProcessor;
78

89
use Magento\Deploy\Console\DeployStaticOptions;
@@ -67,10 +68,10 @@ class Less implements ProcessorInterface
6768
* @param Minification $minification
6869
*/
6970
public function __construct(
70-
FileNameResolver $fileNameResolver,
71+
FileNameResolver $fileNameResolver,
7172
NotationResolver\Module $notationResolver,
72-
DeployStaticFile $deployStaticFile,
73-
Minification $minification
73+
DeployStaticFile $deployStaticFile,
74+
Minification $minification
7475
) {
7576
$this->fileNameResolver = $fileNameResolver;
7677
$this->notationResolver = $notationResolver;
@@ -139,8 +140,10 @@ private function hasOverrides(PackageFile $parentFile, Package $package)
139140
}
140141

141142
/**
142-
* @param string $fileName
143-
* @param string $parentFile
143+
* Checks recursively if there is a LESS file in current package which used for generating given CSS file from parent package
144+
*
145+
* @param string $fileName
146+
* @param string $parentFile
144147
* @param array $map
145148
* @return bool
146149
*/
@@ -173,12 +176,14 @@ private function buildMap($filePath, $packagePath, $contentType)
173176
$content = $this->deployStaticFile->readTmpFile($filePath, $packagePath);
174177
$replaceCallback = function ($matchedContent) use ($filePath, $packagePath, $contentType) {
175178
$matchedFileId = $matchedContent['path'];
179+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
176180
if (!pathinfo($matchedContent['path'], PATHINFO_EXTENSION)) {
177181
$matchedFileId .= '.' . $contentType;
178182
}
179183
if (strpos($matchedFileId, Repository::FILE_ID_SEPARATOR) !== false) {
180184
$basePath = $packagePath;
181185
} else {
186+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
182187
$basePath = pathinfo($filePath, PATHINFO_DIRNAME);
183188
}
184189
$resolvedPath = str_replace(Repository::FILE_ID_SEPARATOR, '/', $matchedFileId);

0 commit comments

Comments
 (0)