diff --git a/.github/workflows/appstore-build-publish.yml b/.github/workflows/appstore-build-publish.yml index 0338310f80..d9a86dea32 100644 --- a/.github/workflows/appstore-build-publish.yml +++ b/.github/workflows/appstore-build-publish.yml @@ -71,7 +71,7 @@ jobs: - name: Set up node ${{ steps.versions.outputs.nodeVersion }} # Skip if no package.json if: ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: ${{ steps.versions.outputs.nodeVersion }} diff --git a/.github/workflows/cypress-component.yml b/.github/workflows/cypress-component.yml index f6e950764e..7bab8d8907 100644 --- a/.github/workflows/cypress-component.yml +++ b/.github/workflows/cypress-component.yml @@ -27,7 +27,7 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - name: Set up node from version file - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7 with: cache: 'npm' cache-dependency-path: package-lock.json diff --git a/.github/workflows/cypress-custom.yml b/.github/workflows/cypress-custom.yml index 6c3e8e4b87..68b333d115 100644 --- a/.github/workflows/cypress-custom.yml +++ b/.github/workflows/cypress-custom.yml @@ -88,7 +88,7 @@ jobs: path: apps/${{ env.APP_NAME }} - name: Set up node from version file - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7 with: cache: 'npm' cache-dependency-path: apps/${{ env.APP_NAME}}/package-lock.json @@ -103,7 +103,7 @@ jobs: - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7 with: node-version: ${{ matrix.node-version }} diff --git a/.github/workflows/lint-eslint.yml b/.github/workflows/lint-eslint.yml index c9af4ba5ab..a5782f7b31 100644 --- a/.github/workflows/lint-eslint.yml +++ b/.github/workflows/lint-eslint.yml @@ -68,7 +68,7 @@ jobs: fallbackNpm: '^10' - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: ${{ steps.versions.outputs.nodeVersion }} diff --git a/.github/workflows/lint-stylelint.yml b/.github/workflows/lint-stylelint.yml index ffcb250966..4299c5cf25 100644 --- a/.github/workflows/lint-stylelint.yml +++ b/.github/workflows/lint-stylelint.yml @@ -37,7 +37,7 @@ jobs: fallbackNpm: '^10' - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: ${{ steps.versions.outputs.nodeVersion }} diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 7ae77ae0b0..d015352d83 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -65,7 +65,7 @@ jobs: fallbackNpm: '^10' - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: ${{ steps.versions.outputs.nodeVersion }} diff --git a/.github/workflows/npm-audit-fix.yml b/.github/workflows/npm-audit-fix.yml index 1fd5dfd14b..bc26cc7e65 100644 --- a/.github/workflows/npm-audit-fix.yml +++ b/.github/workflows/npm-audit-fix.yml @@ -46,7 +46,7 @@ jobs: fallbackNpm: '^10' - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: ${{ steps.versions.outputs.nodeVersion }} diff --git a/.github/workflows/openapi.yml b/.github/workflows/openapi.yml index f6708ee7d6..cfb3cd3f65 100644 --- a/.github/workflows/openapi.yml +++ b/.github/workflows/openapi.yml @@ -62,7 +62,7 @@ jobs: - name: Set up node ${{ steps.node_versions.outputs.nodeVersion }} if: ${{ steps.node_versions.outputs.nodeVersion }} - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: ${{ steps.node_versions.outputs.nodeVersion }} diff --git a/lib/Activity/ActivityManager.php b/lib/Activity/ActivityManager.php index 80f9d92bd0..bed7c4cb6f 100644 --- a/lib/Activity/ActivityManager.php +++ b/lib/Activity/ActivityManager.php @@ -45,7 +45,14 @@ public function __construct( ) { } - public function triggerEvent($objectType, $object, $subject, $additionalParams = [], $author = null) { + /** + * @param array|null|string $additionalParams + * @param (array|null)[]|null|string $author + * + * @psalm-param 'tables_row'|'tables_table' $objectType + * @psalm-param array{before: array|null, after: array|null}|null|string $author + */ + public function triggerEvent(string $objectType, Row2|Table $object, string $subject, array|string|null $additionalParams = [], array|string|null $author = null) { if ($author === null) { $author = $this->userId; } @@ -61,7 +68,11 @@ public function triggerEvent($objectType, $object, $subject, $additionalParams = } } - public function triggerUpdateEvents($objectType, ChangeSet $changeSet, $subject) { + /** + * @psalm-param 'tables_table' $objectType + * @psalm-param 'table_update' $subject + */ + public function triggerUpdateEvents(string $objectType, ChangeSet $changeSet, string $subject) { $previousEntity = $changeSet->getBefore(); $entity = $changeSet->getAfter(); $events = []; @@ -98,7 +109,10 @@ public function triggerUpdateEvents($objectType, ChangeSet $changeSet, $subject) } } - private function createEvent($objectType, $object, $subject, $additionalParams = [], $author = null) { + /** + * @psalm-param array{before?: mixed, after?: mixed} $additionalParams + */ + private function createEvent($objectType, $object, string $subject, array $additionalParams = [], $author = null) { if ($object instanceof Table) { $objectTitle = $object->getTitle(); $table = $object; @@ -200,7 +214,7 @@ private function sendToUsers(IEvent $event, $object) { } } - public function getActivityFormat($language, $subjectIdentifier, $subjectParams = [], $ownActivity = false) { + public function getActivityFormat(string $language, $subjectIdentifier, array $subjectParams = [], bool $ownActivity = false) { $subject = ''; $l = $this->l10nFactory->get(Application::APP_ID, $language); diff --git a/lib/Activity/ChangeSet.php b/lib/Activity/ChangeSet.php index 4ec67cde9d..ea850a537a 100644 --- a/lib/Activity/ChangeSet.php +++ b/lib/Activity/ChangeSet.php @@ -24,11 +24,11 @@ public function __construct( } } - public function setBefore($before) { + public function setBefore(Entity $before) { $this->before = clone $before; } - public function setAfter($after) { + public function setAfter(Entity $after) { $this->after = clone $after; } diff --git a/lib/Db/LegacyRowMapper.php b/lib/Db/LegacyRowMapper.php index 95f04a2bb7..b39859ca07 100644 --- a/lib/Db/LegacyRowMapper.php +++ b/lib/Db/LegacyRowMapper.php @@ -82,7 +82,7 @@ public function find(int $id): LegacyRow { return $this->findEntity($qb); } - private function buildFilterByColumnType($qb, array $filter, string $filterId): ?IQueryFunction { + private function buildFilterByColumnType(IQueryBuilder $qb, array $filter, string $filterId): ?IQueryFunction { try { $columnQbClassName = 'OCA\Tables\Db\ColumnTypes\\'; $type = explode('-', $filter['columnType'])[0]; diff --git a/lib/Db/RowCellMapperSuper.php b/lib/Db/RowCellMapperSuper.php index 30deed7d5f..a38e61f21c 100644 --- a/lib/Db/RowCellMapperSuper.php +++ b/lib/Db/RowCellMapperSuper.php @@ -41,7 +41,10 @@ public function formatEntity(Column $column, RowCellSuper $cell) { * Transform value from a filter rule to the actual query parameter used * for constructing the view filter query */ - public function filterValueToQueryParam(Column $column, mixed $value): mixed { + /** + * @param array|float|null|string $value + */ + public function filterValueToQueryParam(Column $column, array|string|float|null $value): mixed { return $value; } diff --git a/lib/Db/RowCellSuper.php b/lib/Db/RowCellSuper.php index 2b78c510e5..c3cdae256a 100644 --- a/lib/Db/RowCellSuper.php +++ b/lib/Db/RowCellSuper.php @@ -80,7 +80,7 @@ public function setColumnIdWrapper(int $columnId) { $this->setColumnId($columnId); } - public function setValueWrapper($value) { + public function setValueWrapper(array|float|null $value) { $this->setValue($value); } } diff --git a/lib/Model/RowDataInput.php b/lib/Model/RowDataInput.php index dbef7fde0b..21f54cd2f9 100644 --- a/lib/Model/RowDataInput.php +++ b/lib/Model/RowDataInput.php @@ -24,7 +24,10 @@ class RowDataInput implements ArrayAccess, Iterator { /** @psalm-var array */ protected array $data = []; - public function add(int $columnId, mixed $value): self { + /** + * @param array|float|int|null|string $value + */ + public function add(int $columnId, array|string|int|float|null $value): self { $this->data[] = [self::DATA_KEY => $columnId, self::DATA_VAL => $value]; return $this; } diff --git a/lib/Service/ImportService.php b/lib/Service/ImportService.php index 6e349daba5..92fc9274ef 100644 --- a/lib/Service/ImportService.php +++ b/lib/Service/ImportService.php @@ -501,7 +501,10 @@ private function upsertRow(Row $row): void { } } - private function valueToDateTimeImmutable(mixed $value): ?DateTimeImmutable { + /** + * @param null|string $value + */ + private function valueToDateTimeImmutable(string|null $value): ?DateTimeImmutable { if ( $value === false || $value === null diff --git a/lib/Service/ValueObject/ViewColumnInformation.php b/lib/Service/ValueObject/ViewColumnInformation.php index 9f7e311be5..d5c63c42fb 100644 --- a/lib/Service/ValueObject/ViewColumnInformation.php +++ b/lib/Service/ValueObject/ViewColumnInformation.php @@ -98,7 +98,7 @@ public function jsonSerialize(): array { return $this->data; } - protected function ensureType(string $offset, mixed $value): int|bool { + protected function ensureType(string $offset, bool|int $value): int|bool { return match ($offset) { self::KEY_ID, self::KEY_ORDER => (int)$value, diff --git a/vendor-bin/rector/composer.json b/vendor-bin/rector/composer.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/vendor-bin/rector/composer.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/vendor-bin/rector/composer.lock b/vendor-bin/rector/composer.lock new file mode 100644 index 0000000000..ba8d41762c --- /dev/null +++ b/vendor-bin/rector/composer.lock @@ -0,0 +1,18 @@ +{ + "_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": "d751713988987e9331980363e24189ce", + "packages": [], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": {}, + "prefer-stable": false, + "prefer-lowest": false, + "platform": {}, + "platform-dev": {}, + "plugin-api-version": "2.9.0" +}