Skip to content

Commit 4e252de

Browse files
committed
MC-17627: Dependency static test does not analyze content of phtml files
- Fixed codestyle
1 parent bc61b81 commit 4e252de

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

dev/tests/static/testsuite/Magento/Test/Integrity/DependencyTest.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,17 +286,20 @@ private static function getRoutesWhitelist(): array
286286
*/
287287
protected function _getCleanedFileContents($fileType, $file)
288288
{
289+
$contents = null;
289290
switch ($fileType) {
290291
case 'php':
291-
return php_strip_whitespace($file);
292+
$contents = php_strip_whitespace($file);
293+
break;
292294
case 'layout':
293295
case 'config':
294296
//Removing xml comments
295-
return preg_replace(
297+
$contents = preg_replace(
296298
'~\<!\-\-/.*?\-\-\>~s',
297299
'',
298300
file_get_contents($file)
299301
);
302+
break;
300303
case 'template':
301304
$contents = php_strip_whitespace($file);
302305
//Removing html
@@ -309,9 +312,12 @@ function ($matches) use ($contents, &$contentsWithoutHtml) {
309312
},
310313
$contents
311314
);
312-
return $contentsWithoutHtml;
315+
$contents = $contentsWithoutHtml;
316+
break;
317+
default:
318+
$contents = file_get_contents($file);
313319
}
314-
return file_get_contents($file);
320+
return $contents;
315321
}
316322

317323
/**

0 commit comments

Comments
 (0)