Add PHP CS checker

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2020-07-10 10:09:25 +02:00
parent 50605c1d29
commit 3b42325d5d
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
5 changed files with 3693 additions and 5 deletions

1
.gitignore vendored
View File

@ -1,3 +1,2 @@
# due to the different Travis-CI PHP versions we MUST NOT lock to specific versions # due to the different Travis-CI PHP versions we MUST NOT lock to specific versions
composer.lock
vendor vendor

1
.php_cs.cache Normal file
View File

@ -0,0 +1 @@
{"php":"7.4.7","version":"2.16.4:v2.16.4#1023c3458137ab052f6ff1e09621a721bfdeca13","indent":"\t","lineEnding":"\n","rules":{"encoding":true,"full_opening_tag":true,"blank_line_after_namespace":true,"braces":{"position_after_anonymous_constructs":"same","position_after_control_structures":"same","position_after_functions_and_oop_constructs":"same"},"class_definition":true,"constant_case":true,"elseif":true,"function_declaration":{"closure_function_spacing":"one"},"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"no_break_comment":true,"no_closing_tag":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":true,"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":{"elements":["property","method","const"]},"align_multiline_comment":true,"array_indentation":true,"array_syntax":{"syntax":"short"},"blank_line_after_opening_tag":true,"no_unused_imports":true},"hashes":{"lib\/Capabilities.php":2332335149,"lib\/Settings\/RegistrationSettings.php":1187727085,"lib\/Controller\/RegisterController.php":481295791,"lib\/Controller\/SettingsController.php":1057137794,"lib\/Controller\/ApiController.php":1056010743,"lib\/Util\/CoreBridge.php":2569539796,"lib\/Service\/MailService.php":4185218457,"lib\/Service\/RegistrationException.php":1966977026,"lib\/Service\/RegistrationService.php":1344864019,"lib\/AppInfo\/Application.php":1184851739,"lib\/Db\/Registration.php":3951088540,"lib\/Db\/RegistrationMapper.php":3012923546,"templates\/email.newuser_html.php":1706810427,"templates\/email.validate_plaintext.php":1751926117,"templates\/email.newuser_plaintext.php":1706810427,"templates\/admin.php":4102502608,"templates\/message.php":1916485661,"templates\/email.validate_html.php":2905336319,"templates\/domains.php":2396246270,"templates\/form.php":3602162854,"templates\/email.newuser.disabled_plaintext.php":4246922555,"templates\/email.newuser.disabled_html.php":3101190368,"templates\/register.php":3871034857,"tests\/bootstrap.php":2619470924,"tests\/Unit\/Controller\/ApiControllerTest.php":3215627675,"tests\/Integration\/Controller\/RegisterControllerTest.php":3551540727,"tests\/Integration\/Service\/RegistrationServiceTest.php":3309052170,"appinfo\/app.php":2364261601,"appinfo\/routes.php":2340075781}}

18
.php_cs.dist Normal file
View File

@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
require_once './vendor/autoload.php';
use Nextcloud\CodingStandard\Config;
$config = new Config();
$config
->getFinder()
->ignoreVCSIgnored(true)
->notPath('build')
->notPath('l10n')
->notPath('src')
->notPath('vendor')
->in(__DIR__);
return $config;

View File

@ -1,6 +1,12 @@
{ {
"scripts": {
"cs:check": "php-cs-fixer fix --dry-run --diff",
"cs:fix": "php-cs-fixer fix",
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './build/*' -not -path './tests/integration/vendor/*' -print0 | xargs -0 -n1 php -l"
},
"require-dev": { "require-dev": {
"phpunit/phpunit": "^8.0", "phpunit/phpunit": "^8.0",
"christophwurst/nextcloud_testing": "0.10.0" "christophwurst/nextcloud_testing": "0.10.0",
"nextcloud/coding-standard": "^0.3.0"
} }
} }

3664
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff