本文整理汇总了PHP中Magento\Framework\App\Utility\Files::composeDataSets方法的典型用法代码示例。如果您正苦于以下问题:PHP Files::composeDataSets方法的具体用法?PHP Files::composeDataSets怎么用?PHP Files::composeDataSets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\App\Utility\Files
的用法示例。
在下文中一共展示了Files::composeDataSets方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: modulesFilesDataProvider
/**
* Return refactored files
*
* @return array
*/
public function modulesFilesDataProvider()
{
$filesList = [];
foreach ($this->getFilesData('whitelist/refactored_modules*') as $refactoredFolder) {
$files = \Magento\Framework\App\Utility\Files::init()->getFiles([$this->appPath . $refactoredFolder], '*.php');
$filesList = array_merge($filesList, $files);
}
$result = array_map('realpath', $filesList);
$result = array_diff($result, $this->filesBlackList);
return \Magento\Framework\App\Utility\Files::composeDataSets($result);
}
示例2: getPhpFiles
/**
* Returns array of PHP-files, that use or declare Magento application classes and Magento libs
*
* @param string $changedFilesList
* @return array
*/
public static function getPhpFiles($changedFilesList)
{
$fileHelper = \Magento\Framework\App\Utility\Files::init();
if (isset($_ENV['INCREMENTAL_BUILD'])) {
$phpFiles = Files::readLists($changedFilesList);
if (!empty($phpFiles)) {
$phpFiles = \Magento\Framework\App\Utility\Files::composeDataSets($phpFiles);
$phpFiles = array_intersect_key($phpFiles, $fileHelper->getPhpFiles());
}
} else {
$phpFiles = $fileHelper->getPhpFiles();
}
return $phpFiles;
}
示例3: modulesFilesDataProvider
/**
* Return refactored files
*
* @return array
*/
public function modulesFilesDataProvider()
{
$filesList = [];
$componentRegistrar = new ComponentRegistrar();
foreach ($this->getFilesData('whitelist/refactored_modules*') as $refactoredModule) {
if ($componentRegistrar->getPath(ComponentRegistrar::MODULE, $refactoredModule)) {
$files = \Magento\Framework\App\Utility\Files::init()->getFiles([$componentRegistrar->getPath(ComponentRegistrar::MODULE, $refactoredModule)], '*.php');
$filesList = array_merge($filesList, $files);
}
}
$result = array_map('realpath', $filesList);
$result = array_diff($result, $this->filesBlackList);
return \Magento\Framework\App\Utility\Files::composeDataSets($result);
}
示例4: getPhpFiles
/**
* Returns array of PHP-files, that use or declare Magento application classes and Magento libs
*
* @param string $changedFilesList
* @return array
*/
public static function getPhpFiles($changedFilesList)
{
$fileHelper = \Magento\Framework\App\Utility\Files::init();
if (isset($_ENV['INCREMENTAL_BUILD'])) {
$phpFiles = [];
foreach (glob($changedFilesList) as $listFile) {
$phpFiles = array_merge($phpFiles, file($listFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES));
}
array_walk($phpFiles, function (&$file) {
$file = BP . '/' . $file;
});
if (!empty($phpFiles)) {
$phpFiles = \Magento\Framework\App\Utility\Files::composeDataSets($phpFiles);
$phpFiles = array_intersect_key($phpFiles, $fileHelper->getPhpFiles(Files::INCLUDE_APP_CODE | Files::INCLUDE_PUB_CODE | Files::INCLUDE_LIBS | Files::INCLUDE_TEMPLATES | Files::INCLUDE_TESTS | Files::AS_DATA_SET | Files::INCLUDE_NON_CLASSES));
}
} else {
$phpFiles = $fileHelper->getPhpFiles(Files::INCLUDE_APP_CODE | Files::INCLUDE_PUB_CODE | Files::INCLUDE_LIBS | Files::INCLUDE_TEMPLATES | Files::INCLUDE_TESTS | Files::AS_DATA_SET | Files::INCLUDE_NON_CLASSES);
}
return $phpFiles;
}
示例5: testMageMethodsObsolete
public function testMageMethodsObsolete()
{
$ignored = $this->getBlacklistFiles();
$files = Files::init()->getPhpFiles(Files::INCLUDE_APP_CODE | Files::INCLUDE_TESTS | Files::INCLUDE_DEV_TOOLS | Files::INCLUDE_LIBS);
$files = array_map('realpath', $files);
$files = array_diff($files, $ignored);
$files = Files::composeDataSets($files);
$invoker = new AggregateInvoker($this);
$invoker(function ($file) {
$this->_assertNotRegExp('/[^a-z\\d_]Mage\\s*::/i', file_get_contents($file), '"Mage" class methods are obsolete');
}, $files);
}
示例6: mageObsoleteDataProvider
/**
* @return array
*/
public function mageObsoleteDataProvider()
{
$blackList = (include __DIR__ . '/_files/blacklist/obsolete_mage.php');
$ignored = [];
$appPath = \Magento\Framework\App\Utility\Files::init()->getPathToSource();
foreach ($blackList as $file) {
$ignored[] = realpath($appPath . '/' . $file);
}
$files = \Magento\Framework\App\Utility\Files::init()->getClassFiles(true, true, true, true, false);
$files = array_map('realpath', $files);
$files = array_diff($files, $ignored);
return \Magento\Framework\App\Utility\Files::composeDataSets($files);
}