2020-11-17 18:59:12 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
require_once './vendor/autoload.php';
|
|
|
|
|
|
|
|
use Nextcloud\CodingStandard\Config;
|
|
|
|
|
2022-05-21 07:51:01 +03:00
|
|
|
class CookbookConfig extends Config {
|
|
|
|
public function __construct($name = 'default') {
|
|
|
|
parent::__construct($name);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getRules() : array {
|
|
|
|
$parentRules = parent::getRules();
|
|
|
|
$additionalRules = [
|
2022-05-21 08:01:06 +03:00
|
|
|
'phpdoc_add_missing_param_annotation' => true,
|
|
|
|
'phpdoc_indent' => true,
|
|
|
|
'phpdoc_no_empty_return' => true,
|
|
|
|
'phpdoc_scalar' => true,
|
|
|
|
'phpdoc_single_line_var_spacing' => true,
|
|
|
|
'phpdoc_var_without_name' => true
|
2022-05-21 07:51:01 +03:00
|
|
|
];
|
2022-07-06 13:43:34 +03:00
|
|
|
$ret = array_merge(['@PSR12' => true], $parentRules, $additionalRules);
|
|
|
|
// print_r($ret);
|
|
|
|
return $ret;
|
2022-05-21 07:51:01 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$config = new CookbookConfig();
|
2022-07-06 13:43:34 +03:00
|
|
|
$finder = $config
|
2020-11-17 18:59:12 +03:00
|
|
|
->getFinder()
|
2022-07-06 13:43:34 +03:00
|
|
|
// ->ignoreVCSIgnored(true)
|
2021-02-27 17:38:41 +03:00
|
|
|
->exclude('build')
|
|
|
|
->exclude('l10n')
|
|
|
|
->exclude('src')
|
|
|
|
->exclude('node_modules')
|
|
|
|
->exclude('vendor')
|
|
|
|
->exclude('.github')
|
2022-07-06 13:43:34 +03:00
|
|
|
->in(__DIR__ );
|
2022-05-21 07:51:01 +03:00
|
|
|
|
2022-07-06 13:43:34 +03:00
|
|
|
$config->setFinder($finder);
|
|
|
|
|
|
|
|
// foreach($finder as $f) {
|
|
|
|
// print_r($f);
|
|
|
|
// }
|
|
|
|
|
|
|
|
// print_r($config);
|
2022-05-21 07:51:01 +03:00
|
|
|
|
2020-11-17 18:59:12 +03:00
|
|
|
return $config;
|
|
|
|
|