diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a656dbd0521..8f89ad8cf61 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -55,6 +55,7 @@ updates: - "/vendor-bin/mozart" - "/vendor-bin/phpunit" - "/vendor-bin/psalm" + - "/vendor-bin/rector" commit-message: prefix: "ci" include: "scope" diff --git a/composer.json b/composer.json index f86d5406fa1..e7a30fc1cbf 100644 --- a/composer.json +++ b/composer.json @@ -20,6 +20,8 @@ "cs:fix": "php-cs-fixer fix", "lint": "find . -name \\*.php -not -path './vendor/*' -not -path './vendor-bin/*' -not -path './lib/Vendor/*' -not -path './build/*' -not -path './tests/integration/vendor/*' -print0 | xargs -0 -n1 php -l", "openapi": "generate-spec --verbose && (npm run typescript:generate || echo 'Please manually regenerate the typescript OpenAPI models')", + "rector:check": "rector --dry-run", + "rector:fix": "rector", "psalm": "psalm --threads=1", "psalm:dev": "psalm --no-cache --threads=$(nproc)", "psalm:update-baseline": "psalm --threads=1 --update-baseline --set-baseline=tests/psalm-baseline.xml", diff --git a/rector.php b/rector.php new file mode 100644 index 00000000000..cc8f5a31c8a --- /dev/null +++ b/rector.php @@ -0,0 +1,24 @@ +withPaths([ + __DIR__ . '/appinfo', + __DIR__ . '/lib', + __DIR__ . '/templates', + __DIR__ . '/tests/php', + ]) + ->withSkipPath(__DIR__ . '/lib/Vendor') + ->withPhpSets(php73: true) + ->withSets([ + NextcloudSets::NEXTCLOUD_27, + ]) + ->withTypeCoverageLevel(0); diff --git a/templates/index.php b/templates/index.php index 166a634b487..4a557e8f9f6 100644 --- a/templates/index.php +++ b/templates/index.php @@ -6,5 +6,5 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -script('spreed', 'talk-main'); +\OCP\Util::addScript('spreed', 'talk-main'); style('spreed', 'icons'); diff --git a/templates/recording.php b/templates/recording.php index bf00762259e..cc0a1a71f3d 100644 --- a/templates/recording.php +++ b/templates/recording.php @@ -6,5 +6,5 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -script('spreed', 'talk-recording'); +\OCP\Util::addScript('spreed', 'talk-recording'); style('spreed', 'icons'); diff --git a/vendor-bin/rector/composer.json b/vendor-bin/rector/composer.json new file mode 100644 index 00000000000..161da175378 --- /dev/null +++ b/vendor-bin/rector/composer.json @@ -0,0 +1,6 @@ +{ + "require-dev": { + "rector/rector": "^1.2.0", + "nextcloud/rector": "^0.2.1" + } +} diff --git a/vendor-bin/rector/composer.lock b/vendor-bin/rector/composer.lock new file mode 100644 index 00000000000..34a7b3f7763 --- /dev/null +++ b/vendor-bin/rector/composer.lock @@ -0,0 +1,198 @@ +{ + "_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": "70a6b9ee5d177a2650153d88a8a02362", + "packages": [], + "packages-dev": [ + { + "name": "nextcloud/rector", + "version": "v0.2.1", + "source": { + "type": "git", + "url": "https://github.com/nextcloud-libraries/rector.git", + "reference": "d73ab086700564f675eda9a834b6b08410a1da7e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nextcloud-libraries/rector/zipball/d73ab086700564f675eda9a834b6b08410a1da7e", + "reference": "d73ab086700564f675eda9a834b6b08410a1da7e", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.5", + "ramsey/devtools": "^2.0", + "rector/rector": "^1.2" + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + }, + "ramsey/conventional-commits": { + "configFile": "conventional-commits.json" + }, + "ramsey/devtools": { + "command-prefix": "dev", + "memory-limit": "-1" + } + }, + "autoload": { + "psr-4": { + "Nextcloud\\Rector\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "AGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Christoph Wurst", + "email": "christoph@winzerhof-wurst.at", + "homepage": "https://wuc.me" + } + ], + "description": "Rector upgrade rules for Nextcloud", + "keywords": [ + "nextcloud", + "refactoring" + ], + "support": { + "issues": "https://github.com/nextcloud-libraries/rector/issues", + "source": "https://github.com/nextcloud-libraries/rector/tree/v0.2.1" + }, + "time": "2024-10-01T12:24:08+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "1.12.6", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "dc4d2f145a88ea7141ae698effd64d9df46527ae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/dc4d2f145a88ea7141ae698effd64d9df46527ae", + "reference": "dc4d2f145a88ea7141ae698effd64d9df46527ae", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + } + ], + "time": "2024-10-06T15:03:59+00:00" + }, + { + "name": "rector/rector", + "version": "1.2.6", + "source": { + "type": "git", + "url": "https://github.com/rectorphp/rector.git", + "reference": "6ca85da28159dbd3bb36211c5104b7bc91278e99" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/6ca85da28159dbd3bb36211c5104b7bc91278e99", + "reference": "6ca85da28159dbd3bb36211c5104b7bc91278e99", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0", + "phpstan/phpstan": "^1.12.5" + }, + "conflict": { + "rector/rector-doctrine": "*", + "rector/rector-downgrade-php": "*", + "rector/rector-phpunit": "*", + "rector/rector-symfony": "*" + }, + "suggest": { + "ext-dom": "To manipulate phpunit.xml via the custom-rule command" + }, + "bin": [ + "bin/rector" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Instant Upgrade and Automated Refactoring of any PHP code", + "keywords": [ + "automation", + "dev", + "migration", + "refactoring" + ], + "support": { + "issues": "https://github.com/rectorphp/rector/issues", + "source": "https://github.com/rectorphp/rector/tree/1.2.6" + }, + "funding": [ + { + "url": "https://github.com/tomasvotruba", + "type": "github" + } + ], + "time": "2024-10-03T08:56:44+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.6.0" +}