diff --git a/.gitignore b/.gitignore index 316ede4c..8ba3932f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ js/ report clover.xml composer.lock +.php_cs.cache appinfo/info.xsd # just sane ignores diff --git a/.php_cs.dist b/.php_cs.dist new file mode 100644 index 00000000..f7bbdd81 --- /dev/null +++ b/.php_cs.dist @@ -0,0 +1,18 @@ +getFinder() + ->ignoreVCSIgnored(true) + ->notPath('build') + ->notPath('l10n') + ->notPath('src') + ->notPath('vendor') + ->in(__DIR__); +return $config; diff --git a/Makefile b/Makefile index a4180ac4..c6ae5d42 100644 --- a/Makefile +++ b/Makefile @@ -88,8 +88,8 @@ test-api: lint: lint-php lint-js lint-css lint-xml -lint-php: lint-php-lint lint-php-ncversion lint-php-phan lint-php-phpcs -lint-phpfast: lint-php-lint lint-php-ncversion lint-php-phpcs +lint-php: lint-phpfast lint-php-phan +lint-phpfast: lint-php-lint lint-php-ncversion lint-php-cs-fixer lint-php-phpcs lint-php-lint: # Check PHP syntax errors @@ -107,6 +107,10 @@ lint-php-phpcs: # PHP CodeSniffer vendor/bin/phpcs --standard=tests/phpcs.xml appinfo/ lib/ tests/api/ --report=checkstyle | vendor/bin/cs2pr --graceful-warnings --colorize +lint-php-cs-fixer: + # PHP Coding Standards Fixer (with Nextcloud coding standards) + vendor/bin/php-cs-fixer fix --dry-run --diff + lint-js: npm run lint @@ -125,6 +129,7 @@ lint-fix: lint-php-fix lint-js-fix lint-css-fix lint-php-fix: vendor/bin/phpcbf --standard=tests/phpcs.xml appinfo/ lib/ tests/api/ + vendor/bin/php-cs-fixer fix lint-js-fix: npm run lint:fix diff --git a/appinfo/routes.php b/appinfo/routes.php index 90e67389..a51ee6d6 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -1,4 +1,5 @@ [ ////////// P A G E ////////// [ diff --git a/composer.json b/composer.json index 6a443ff4..f284c82a 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,7 @@ { "require-dev": { "christophwurst/nextcloud": "^16.0", + "nextcloud/coding-standard": "^0.3.0", "squizlabs/php_codesniffer": "3.*", "phan/phan": "^3.0", "guzzlehttp/guzzle": "^7.0", diff --git a/lib/Application.php b/lib/Application.php index 9307156b..8e36797a 100644 --- a/lib/Application.php +++ b/lib/Application.php @@ -1,11 +1,12 @@ -$getter()] = $entity; } diff --git a/lib/Service/Note.php b/lib/Service/Note.php index ea94e1b4..f17c66f8 100644 --- a/lib/Service/Note.php +++ b/lib/Service/Note.php @@ -1,4 +1,6 @@ - diff --git a/tests/api/APIv02Test.php b/tests/api/APIv02Test.php index cbca70de..2bd51e66 100644 --- a/tests/api/APIv02Test.php +++ b/tests/api/APIv02Test.php @@ -1,9 +1,10 @@ - 'integer', 'content' => 'string',