Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/appstore-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cypress-component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cypress-custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-stylelint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm-audit-fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
22 changes: 18 additions & 4 deletions lib/Activity/ActivityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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 = [];
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions lib/Activity/ChangeSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Db/LegacyRowMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
5 changes: 4 additions & 1 deletion lib/Db/RowCellMapperSuper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Db/RowCellSuper.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
$this->setColumnId($columnId);
}

public function setValueWrapper($value) {
public function setValueWrapper(array|float|null $value) {
$this->setValue($value);

Check failure on line 84 in lib/Db/RowCellSuper.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable30

InvalidArgument

lib/Db/RowCellSuper.php:84:19: InvalidArgument: Argument 1 of setValue expects string, but array<array-key, mixed>|float|null provided (see https://psalm.dev/004)

Check failure on line 84 in lib/Db/RowCellSuper.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable32

InvalidArgument

lib/Db/RowCellSuper.php:84:19: InvalidArgument: Argument 1 of setValue expects string, but array<array-key, mixed>|float|null provided (see https://psalm.dev/004)
}
}
5 changes: 4 additions & 1 deletion lib/Model/RowDataInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ class RowDataInput implements ArrayAccess, Iterator {
/** @psalm-var array<array{'columnId': int, 'value': mixed}> */
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;
}
Expand Down
5 changes: 4 additions & 1 deletion lib/Service/ImportService.php
Original file line number Diff line number Diff line change
Expand Up @@ -501,18 +501,21 @@
}
}

private function valueToDateTimeImmutable(mixed $value): ?DateTimeImmutable {
/**
* @param null|string $value
*/
private function valueToDateTimeImmutable(string|null $value): ?DateTimeImmutable {
if (
$value === false

Check failure on line 509 in lib/Service/ImportService.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable30

TypeDoesNotContainType

lib/Service/ImportService.php:509:4: TypeDoesNotContainType: Type null|string for $value is never !false (see https://psalm.dev/056)

Check failure on line 509 in lib/Service/ImportService.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable30

TypeDoesNotContainType

lib/Service/ImportService.php:509:4: TypeDoesNotContainType: null|string does not contain false (see https://psalm.dev/056)

Check failure on line 509 in lib/Service/ImportService.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable32

TypeDoesNotContainType

lib/Service/ImportService.php:509:4: TypeDoesNotContainType: Type null|string for $value is never !false (see https://psalm.dev/056)

Check failure on line 509 in lib/Service/ImportService.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable32

TypeDoesNotContainType

lib/Service/ImportService.php:509:4: TypeDoesNotContainType: null|string does not contain false (see https://psalm.dev/056)
|| $value === null
|| (is_string($value)

Check failure on line 511 in lib/Service/ImportService.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable30

RedundantCondition

lib/Service/ImportService.php:511:8: RedundantCondition: Type string for $value is always string (see https://psalm.dev/122)

Check failure on line 511 in lib/Service/ImportService.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable32

RedundantCondition

lib/Service/ImportService.php:511:8: RedundantCondition: Type string for $value is always string (see https://psalm.dev/122)
&& mb_strlen($value) < 3 // Let pass potential 3-letter month names
&& preg_match('/\d/', $value) !== 1) // or anything containing a digit
) {
return null;
}
try {
$dt = Date::excelToDateTimeObject($value);

Check failure on line 518 in lib/Service/ImportService.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable30

InvalidScalarArgument

lib/Service/ImportService.php:518:38: InvalidScalarArgument: Argument 1 of OCA\Tables\Vendor\PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject expects float|int, but string provided (see https://psalm.dev/012)

Check failure on line 518 in lib/Service/ImportService.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable32

InvalidScalarArgument

lib/Service/ImportService.php:518:38: InvalidScalarArgument: Argument 1 of OCA\Tables\Vendor\PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject expects float|int, but string provided (see https://psalm.dev/012)
Date::roundMicroseconds($dt);
return DateTimeImmutable::createFromMutable($dt);
} catch (TypeError) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/ValueObject/ViewColumnInformation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions vendor-bin/rector/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
18 changes: 18 additions & 0 deletions vendor-bin/rector/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading