nextcloud-swarm-plugin/.php-cs-fixer.dist.php
Mahyar Iranibazaz f2501b13ea
Feature/1088-code-style-setup (#97)
* feat(cs): update cs config

* feat(cs): update composer deps

* feat(cs): gitignore

* feat(cs): add pipeline

* feat(cs): code style

* perf(cs): update pipeline
- refactor: changed name to Lint
- add: auto commit action
- add: fast fail
- update: install only cs-fixer dep

* Apply automatic changes

* feat(cs): update auto commit
- update: commit message

* feat(cs): enable PSR12 and PhpCsFixer rules
- add: extend NC rules
- chore: lint new rules
- fix: OC PSR4 detection
- add: global imports
- add: trailing comma in arrays and etc

* refactor(file): find_exists return value

* chore: fix code style

* refactor(swarm): ref check and param arg type

* refactor(swarm): param arg type

* chore: fix code style

---------

Co-authored-by: mahiarirani <mahiarirani@users.noreply.github.com>
Co-authored-by: JoaoSRaposo <joaosraposo@gmail.com>
2025-01-06 13:48:55 +00:00

37 lines
823 B
PHP

<?php
declare(strict_types=1);
require_once './vendor/autoload.php';
use Nextcloud\CodingStandard\Config as Base;
use PhpCsFixer\Runner\Parallel\ParallelConfig;
class Config extends Base {
public function getRules(array $rules = []): array
{
return [
...parent::getRules(), // Nextcloud Standard Rules
'@PSR12' => true,
'@PhpCsFixer' => true,
'global_namespace_import' => [
'import_classes' => true,
],
'trailing_comma_in_multiline' => ['elements' => ['arguments', 'arrays', 'match', 'parameters']],
];
}
}
$config = new Config();
$config
->setParallelConfig(new ParallelConfig(8))
->setRiskyAllowed(true)
->getFinder()
->ignoreVCSIgnored(true)
->notPath('dev-environment')
->notPath('build')
->notPath('l10n')
->notPath('src')
->notPath('vendor')
->in(__DIR__);
return $config;