https://github.com/owncloud/core
Raw File
Tip revision: c5f4bd2123d0e09785b1d59807bfcb0da2c948de authored by Pasquale Tripodi on 10 July 2019, 16:19:56 UTC
Extend the app update code to verify the app folder name
Tip revision: c5f4bd2
.php_cs.dist
<?php

$dirToParse = 'apps';
$dirIterator = new DirectoryIterator(__DIR__ . '/' . $dirToParse);

$bundledApps = [
	'comments',
	'dav',
	'federatedfilesharing',
	'federation',
	'files',
	'files_external',
	'files_sharing',
	'files_trashbin',
	'files_versions',
	'provisioning_api',
	'systemtags',
	'updatenotification'
];

$excludeDirs = [
	'lib/composer',
	'build',
	'apps/files_external/3rdparty',
	'apps-external',
	'config',
	'data',
	'3rdparty',
];

foreach ($dirIterator as $fileinfo) {
	$filename = $fileinfo->getFilename();
	if ($fileinfo->isDir() && !$fileinfo->isDot() && !in_array($filename, $bundledApps)) {
		$excludeDirs[] = $dirToParse . '/' . $filename;
	}
}

$finder = PhpCsFixer\Finder::create()
	->exclude($excludeDirs)
	->notPath('tests/autoconfig*')
	->in(__DIR__);

$config = new OC\CodingStandard\Config();
$config->setFinder($finder);
return $config;
back to top