diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e0090755b..aa47ca4de 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,6 +11,17 @@ updates: labels: - 3. to review - dependencies +- package-ecosystem: composer + directory: "/vendor-bin/cs-fixer" + schedule: + interval: weekly + day: saturday + time: "03:00" + timezone: Europe/Paris + open-pull-requests-limit: 10 + labels: + - 3. to review + - dependencies - package-ecosystem: npm directory: "/" schedule: diff --git a/.github/workflows/phpunit-oci.yml b/.github/workflows/phpunit-oci.yml index 1b02fc735..7113e50f4 100644 --- a/.github/workflows/phpunit-oci.yml +++ b/.github/workflows/phpunit-oci.yml @@ -34,7 +34,7 @@ concurrency: jobs: phpunit-oci: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: matrix: diff --git a/.gitignore b/.gitignore index fbdf032ee..ed3015094 100644 --- a/.gitignore +++ b/.gitignore @@ -59,6 +59,7 @@ nbproject /tests/js/run.sh /tests/karma-coverage /vendor +/vendor-bin/*/vendor /.php-cs-fixer.cache # Vue.js diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 8a0cb43c8..3ff6486d2 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -2,7 +2,7 @@ declare(strict_types=1); -require_once './vendor/autoload.php'; +require_once './vendor-bin/cs-fixer/vendor/autoload.php'; use Nextcloud\CodingStandard\Config; diff --git a/composer.json b/composer.json index 41d01737d..53bfc189d 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,10 @@ "platform": { "php": "8.0" }, - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "bamarni/composer-bin-plugin": true + } }, "autoload-dev": { "psr-4": { @@ -18,18 +21,32 @@ }, "scripts": { "lint": "find . -name \\*.php -not -path './vendor/*' -not -path './build/*' -print0 | xargs -0 -n1 php -l", - "cs:check": "vendor/bin/php-cs-fixer fix --dry-run --diff", - "cs:fix": "vendor/bin/php-cs-fixer fix", + "cs:check": "php-cs-fixer fix --dry-run --diff", + "cs:fix": "php-cs-fixer fix", "psalm": "psalm.phar --threads=1", "psalm:update-baseline": "psalm.phar--threads=1 --update-baseline --set-baseline=tests/psalm-baseline.xml", "psalm:clear": "psalm.phar--clear-cache && psalm.phar--clear-global-cache", "psalm:fix": "psalm.phar--alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType", - "test:unit": "vendor/bin/phpunit -c tests/phpunit.xml --color --fail-on-warning --fail-on-risky" + "test:unit": "vendor/bin/phpunit -c tests/phpunit.xml --color --fail-on-warning --fail-on-risky", + "post-install-cmd": [ + "@composer bin all install --ansi" + ], + "post-update-cmd": [ + "@composer bin all update --ansi" + ] }, "require-dev": { - "nextcloud/coding-standard": "^1.0.0", "nextcloud/ocp": "dev-master", "phpunit/phpunit": "^9.5", "psalm/phar": "^5.15" + }, + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "require": { + "bamarni/composer-bin-plugin": "^1.8" } } diff --git a/composer.lock b/composer.lock index cfcb8f001..df0cc13d5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,66 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "25a19628605ade7b6fad58e613bccf06", - "packages": [], + "content-hash": "8946fd08dd17a1a9c4cb497d315158fe", + "packages": [ + { + "name": "bamarni/composer-bin-plugin", + "version": "1.8.2", + "source": { + "type": "git", + "url": "https://github.com/bamarni/composer-bin-plugin.git", + "reference": "92fd7b1e6e9cdae19b0d57369d8ad31a37b6a880" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bamarni/composer-bin-plugin/zipball/92fd7b1e6e9cdae19b0d57369d8ad31a37b6a880", + "reference": "92fd7b1e6e9cdae19b0d57369d8ad31a37b6a880", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.0", + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "composer/composer": "^2.0", + "ext-json": "*", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.5", + "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", + "symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", + "symfony/process": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0" + }, + "type": "composer-plugin", + "extra": { + "class": "Bamarni\\Composer\\Bin\\BamarniBinPlugin" + }, + "autoload": { + "psr-4": { + "Bamarni\\Composer\\Bin\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "No conflicts for your bin dependencies", + "keywords": [ + "composer", + "conflict", + "dependency", + "executable", + "isolation", + "tool" + ], + "support": { + "issues": "https://github.com/bamarni/composer-bin-plugin/issues", + "source": "https://github.com/bamarni/composer-bin-plugin/tree/1.8.2" + }, + "time": "2022-10-31T08:38:03+00:00" + } + ], "packages-dev": [ { "name": "doctrine/instantiator", @@ -136,59 +194,18 @@ ], "time": "2023-03-08T13:26:56+00:00" }, - { - "name": "nextcloud/coding-standard", - "version": "v1.1.1", - "source": { - "type": "git", - "url": "https://github.com/nextcloud/coding-standard.git", - "reference": "55def702fb9a37a219511e1d8c6fe8e37164c1fb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/55def702fb9a37a219511e1d8c6fe8e37164c1fb", - "reference": "55def702fb9a37a219511e1d8c6fe8e37164c1fb", - "shasum": "" - }, - "require": { - "php": "^7.3|^8.0", - "php-cs-fixer/shim": "^3.17" - }, - "type": "library", - "autoload": { - "psr-4": { - "Nextcloud\\CodingStandard\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christoph Wurst", - "email": "christoph@winzerhof-wurst.at" - } - ], - "description": "Nextcloud coding standards for the php cs fixer", - "support": { - "issues": "https://github.com/nextcloud/coding-standard/issues", - "source": "https://github.com/nextcloud/coding-standard/tree/v1.1.1" - }, - "time": "2023-06-01T12:05:01+00:00" - }, { "name": "nextcloud/ocp", "version": "dev-master", "source": { "type": "git", "url": "https://github.com/nextcloud-deps/ocp.git", - "reference": "cb36d570c3b7aae1735599cc4b3614b9ce5c9c79" + "reference": "0a5f3a379cda862d4341c15eb7b2c880025b120e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/cb36d570c3b7aae1735599cc4b3614b9ce5c9c79", - "reference": "cb36d570c3b7aae1735599cc4b3614b9ce5c9c79", + "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/0a5f3a379cda862d4341c15eb7b2c880025b120e", + "reference": "0a5f3a379cda862d4341c15eb7b2c880025b120e", "shasum": "" }, "require": { @@ -220,7 +237,7 @@ "issues": "https://github.com/nextcloud-deps/ocp/issues", "source": "https://github.com/nextcloud-deps/ocp/tree/master" }, - "time": "2023-08-26T00:28:49+00:00" + "time": "2023-09-06T00:30:37+00:00" }, { "name": "nikic/php-parser", @@ -389,58 +406,6 @@ }, "time": "2022-02-21T01:04:05+00:00" }, - { - "name": "php-cs-fixer/shim", - "version": "v3.23.0", - "source": { - "type": "git", - "url": "https://github.com/PHP-CS-Fixer/shim.git", - "reference": "ddca9b342374087121e44cca3b7d8aca8f121fa7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/ddca9b342374087121e44cca3b7d8aca8f121fa7", - "reference": "ddca9b342374087121e44cca3b7d8aca8f121fa7", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-tokenizer": "*", - "php": "^7.4 || ^8.0" - }, - "replace": { - "friendsofphp/php-cs-fixer": "self.version" - }, - "suggest": { - "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters." - }, - "bin": [ - "php-cs-fixer", - "php-cs-fixer.phar" - ], - "type": "application", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Dariusz Rumiński", - "email": "dariusz.ruminski@gmail.com" - } - ], - "description": "A tool to automatically fix PHP code style", - "support": { - "issues": "https://github.com/PHP-CS-Fixer/shim/issues", - "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.23.0" - }, - "time": "2023-08-14T12:28:46+00:00" - }, { "name": "phpunit/php-code-coverage", "version": "9.2.27", diff --git a/vendor-bin/cs-fixer/composer.json b/vendor-bin/cs-fixer/composer.json new file mode 100644 index 000000000..8ec2d2b65 --- /dev/null +++ b/vendor-bin/cs-fixer/composer.json @@ -0,0 +1,9 @@ +{ + "platform": { + "php": "8.0" + }, + "sort-packages": true, + "require-dev": { + "nextcloud/coding-standard": "^1.1" + } +} diff --git a/vendor-bin/cs-fixer/composer.lock b/vendor-bin/cs-fixer/composer.lock new file mode 100644 index 000000000..22c81e923 --- /dev/null +++ b/vendor-bin/cs-fixer/composer.lock @@ -0,0 +1,112 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "29631ef900965e2ca760c33e75a459dc", + "packages": [], + "packages-dev": [ + { + "name": "nextcloud/coding-standard", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/nextcloud/coding-standard.git", + "reference": "55def702fb9a37a219511e1d8c6fe8e37164c1fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/55def702fb9a37a219511e1d8c6fe8e37164c1fb", + "reference": "55def702fb9a37a219511e1d8c6fe8e37164c1fb", + "shasum": "" + }, + "require": { + "php": "^7.3|^8.0", + "php-cs-fixer/shim": "^3.17" + }, + "type": "library", + "autoload": { + "psr-4": { + "Nextcloud\\CodingStandard\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christoph Wurst", + "email": "christoph@winzerhof-wurst.at" + } + ], + "description": "Nextcloud coding standards for the php cs fixer", + "support": { + "issues": "https://github.com/nextcloud/coding-standard/issues", + "source": "https://github.com/nextcloud/coding-standard/tree/v1.1.1" + }, + "time": "2023-06-01T12:05:01+00:00" + }, + { + "name": "php-cs-fixer/shim", + "version": "v3.25.1", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/shim.git", + "reference": "448b7c1a3bf190c14fadc5c67e9d93373bfe0aee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/448b7c1a3bf190c14fadc5c67e9d93373bfe0aee", + "reference": "448b7c1a3bf190c14fadc5c67e9d93373bfe0aee", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0" + }, + "replace": { + "friendsofphp/php-cs-fixer": "self.version" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer", + "php-cs-fixer.phar" + ], + "type": "application", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "support": { + "issues": "https://github.com/PHP-CS-Fixer/shim/issues", + "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.25.1" + }, + "time": "2023-09-04T01:23:51+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.6.0" +}