Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/rector-apply.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
#
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT

name: Apply rector changes

on:
workflow_dispatch:
schedule:
# At 14:30 on Sundays
- cron: '30 14 * * 0'

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

name: rector-apply

steps:
- name: Checkout
id: checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
ref: ${{ github.event.repository.default_branch }}

- name: Get php version
id: versions
uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2

- name: Set up php${{ steps.versions.outputs.php-min }}
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
php-version: ${{ steps.versions.outputs.php-min }}
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
coverage: none
ini-file: development
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Remove nextcloud/ocp
run: |
composer remove nextcloud/ocp --dev --no-scripts

- name: Install composer dependencies
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0

- name: Rector
run: composer run rector

- name: Create Pull Request
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
token: ${{ secrets.COMMAND_BOT_PAT }}
commit-message: 'refactor: Apply rector changes'
committer: GitHub <noreply@github.com>
author: nextcloud-command <nextcloud-command@users.noreply.github.com>
signoff: true
branch: automated/noid/rector-changes
title: 'Apply rector changes'
labels: |
technical debt
9 changes: 9 additions & 0 deletions .github/workflows/rector-apply.yml.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
diff --git a/.github/workflows/rector-apply.yml b/.github/workflows/rector-apply.yml
index c61c5b1062..c98cbe3721 100644
--- a/.github/workflows/rector-apply.yml
+++ b/.github/workflows/rector-apply.yml
@@ -67,4 +67,3 @@ jobs:
title: 'Apply rector changes'
labels: |
technical debt
- 3. to review
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"lint": "find . -type f -name '*.php' -not -path './vendor/*' -not -path './vendor-bin/*' -not -path './lib/Vendor/*' -not -path './build/*' -not -path './tests/integration/vendor/*' -not -path 'tests/stubs/*' -print0 | xargs -0 -n200 -P$(nproc) php -l",
"openapi": "generate-spec && (npm run ts:generate || echo 'Please manually regenerate the typescript OpenAPI models')",
"rector:check": "rector --dry-run",
"rector:fix": "rector && php-cs-fixer fix",
"rector": "rector && php-cs-fixer fix",
"psalm": "psalm --no-cache --threads=$(nproc)",
"psalm:dev": "@psalm",
"psalm:update-baseline": "psalm --threads=1 --update-baseline --set-baseline=tests/psalm-baseline.xml",
Expand Down
2 changes: 1 addition & 1 deletion lib/Model/SessionMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function findSessionIdsWithoutAttendee(int $limit): array {

$result = $query->executeQuery();
$ids = [];
while ($row = $result->fetch()) {
while ($row = $result->fetchAssociative()) {
$ids[] = (int)$row['id'];
}
$result->closeCursor();
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/RecordingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function store(Room $room, string $owner, array $file): void {
$this->appConfig->deleteAppValue(self::APPCONFIG_PREFIX . $room->getToken());
try {
$participant = $this->participantService->getParticipant($room, $owner);
} catch (ParticipantNotFoundException $e) {
} catch (ParticipantNotFoundException) {
throw new InvalidArgumentException('owner_participant');
}

Expand Down
4 changes: 3 additions & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
->withPhpSets(php83: true)
->withSets([
PHPUnitSetList::PHPUNIT_120,
NextcloudSets::NEXTCLOUD_34,
PHPUnitSetList::PHPUNIT_NARROW_ASSERTS,
PHPUnitSetList::PHPUNIT_MOCK_TO_STUB,
NextcloudSets::NEXTCLOUD_35,
])
->withSkip([
ReplaceInjectedMethodCallRector::class,
Expand Down
Loading