|
3 | 3 | * Copyright © Magento, Inc. All rights reserved.
|
4 | 4 | * See COPYING.txt for license details.
|
5 | 5 | */
|
| 6 | + |
6 | 7 | namespace Magento\Deploy\Package\Processor\PreProcessor;
|
7 | 8 |
|
8 | 9 | use Magento\Deploy\Console\DeployStaticOptions;
|
@@ -67,10 +68,10 @@ class Less implements ProcessorInterface
|
67 | 68 | * @param Minification $minification
|
68 | 69 | */
|
69 | 70 | public function __construct(
|
70 |
| - FileNameResolver $fileNameResolver, |
| 71 | + FileNameResolver $fileNameResolver, |
71 | 72 | NotationResolver\Module $notationResolver,
|
72 |
| - DeployStaticFile $deployStaticFile, |
73 |
| - Minification $minification |
| 73 | + DeployStaticFile $deployStaticFile, |
| 74 | + Minification $minification |
74 | 75 | ) {
|
75 | 76 | $this->fileNameResolver = $fileNameResolver;
|
76 | 77 | $this->notationResolver = $notationResolver;
|
@@ -139,8 +140,10 @@ private function hasOverrides(PackageFile $parentFile, Package $package)
|
139 | 140 | }
|
140 | 141 |
|
141 | 142 | /**
|
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 |
144 | 147 | * @param array $map
|
145 | 148 | * @return bool
|
146 | 149 | */
|
@@ -173,12 +176,14 @@ private function buildMap($filePath, $packagePath, $contentType)
|
173 | 176 | $content = $this->deployStaticFile->readTmpFile($filePath, $packagePath);
|
174 | 177 | $replaceCallback = function ($matchedContent) use ($filePath, $packagePath, $contentType) {
|
175 | 178 | $matchedFileId = $matchedContent['path'];
|
| 179 | + // phpcs:ignore Magento2.Functions.DiscouragedFunction |
176 | 180 | if (!pathinfo($matchedContent['path'], PATHINFO_EXTENSION)) {
|
177 | 181 | $matchedFileId .= '.' . $contentType;
|
178 | 182 | }
|
179 | 183 | if (strpos($matchedFileId, Repository::FILE_ID_SEPARATOR) !== false) {
|
180 | 184 | $basePath = $packagePath;
|
181 | 185 | } else {
|
| 186 | + // phpcs:ignore Magento2.Functions.DiscouragedFunction |
182 | 187 | $basePath = pathinfo($filePath, PATHINFO_DIRNAME);
|
183 | 188 | }
|
184 | 189 | $resolvedPath = str_replace(Repository::FILE_ID_SEPARATOR, '/', $matchedFileId);
|
|
0 commit comments