-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3898 from magento-arcticfoxes/2.3-develop-pr
[2.3-develop] Sync with 2.3.1-release
- Loading branch information
Showing
10 changed files
with
88 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
dev/tests/static/framework/Magento/TestFramework/Dependency/AnalyticsConfigRule.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Magento\TestFramework\Dependency; | ||
|
||
/** | ||
* Class provides dependency rule for analytics.xml config file. | ||
*/ | ||
class AnalyticsConfigRule implements RuleInterface | ||
{ | ||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getDependencyInfo($currentModule, $fileType, $file, &$contents) | ||
{ | ||
if ('config' != $fileType || !preg_match('#.*/analytics\.xml$#', $file)) { | ||
return []; | ||
} | ||
|
||
$dependenciesInfo = []; | ||
if (preg_match_all('#<[customProvider|reportProvider][^>]*class=[\'"]([^\'"]+)[\'"]#i', $contents, $matches)) { | ||
$classes = array_pop($matches); | ||
foreach ($classes as $class) { | ||
$classParts = explode('\\', $class); | ||
$module = implode('\\', array_slice($classParts, 0, 2)); | ||
if (strtolower($currentModule) !== strtolower($module)) { | ||
$dependenciesInfo[] = [ | ||
'module' => $module, | ||
'type' => RuleInterface::TYPE_HARD, | ||
'source' => $file, | ||
]; | ||
} | ||
} | ||
} | ||
|
||
return $dependenciesInfo; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters