Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3b7eac3
chore(psalm): Migrate spaces to tabs
mejo- May 20, 2025
7f0f056
test(psalm): Bump error level to 4
mejo- May 26, 2025
deed7a9
fix(PageInfo): Allow null `fullWidth`
mejo- May 26, 2025
45d6559
fix(CollectiveStorage): Fix return type and add missing import
mejo- May 26, 2025
17b30e9
fix(ExpireManager): Remove dead logic
mejo- May 26, 2025
a526189
fix(ExpireManager): Do not expire labeled versions
mejo- May 26, 2025
de924e2
fix(ExpireManager): Add missing return types
mejo- May 26, 2025
5111991
fix(ExpireManager): Remove accidentally removed condition
mejo- May 26, 2025
e66c649
fix(VersionsBackend): Fix type for CollectiveVersion argument
mejo- May 26, 2025
eaed2db
fix(CollectiveShare): Adjust return types and remove dead code
mejo- May 26, 2025
c4cac94
fix(psalm): Update stubs for circles app
mejo- May 26, 2025
2bb4897
chore(psalm): Migrate spaces to tabs
mejo- May 26, 2025
1142ed6
fix(MountProvider): Remove nulls from returned array in getMountsForUser
mejo- May 26, 2025
d5582f8
fix: Don't call `getUID()` on null
mejo- May 26, 2025
a9d01d5
fix(PageController): always pass index to copy/move function
mejo- May 26, 2025
1a6d283
fix(CollectiveUserSettings): Fix return types
mejo- May 26, 2025
cfdcf7b
fix(DB): Replace deprecated `QueryBuilder->execute()` with `executeQu…
mejo- May 26, 2025
d8189c0
fix(FileIndexer): Make psalm happy by using a local variable for index
mejo- May 26, 2025
1703911
fix(DB): Fix return codes
mejo- May 26, 2025
b44d400
fix(Listeners): Handle empty userId
mejo- May 26, 2025
3826a17
fix(PageInfo): Always pass int to `setSize`
mejo- May 26, 2025
938c4d6
fix(Migration): Fix return type
mejo- May 26, 2025
737c39a
fix(CollectiveFolderManager): Several typing fixes
mejo- May 26, 2025
3d9bf05
fix(CollectiveFolderManager): Ignore inShare from cli
mejo- May 26, 2025
913b2d2
fix(CircleHelper): Make psalm ignore false positives
mejo- May 26, 2025
b27da7e
fix(TemplateService): Fix typing for parentId
mejo- May 26, 2025
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
Prev Previous commit
Next Next commit
fix(DB): Fix return codes
Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- committed May 26, 2025
commit 1703911ab765a3280fc5f7fe8dd663dbc997ebb6
8 changes: 4 additions & 4 deletions lib/Db/Collective.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ class Collective extends Entity implements JsonSerializable {
protected bool $userShowMembers = Collective::defaultShowMembers;
protected bool $userShowRecentPages = Collective::defaultShowRecentPages;
protected array $userFavoritePages = [];
protected ?bool $canLeave = null;
protected bool $canLeave = false;

public function getCircleId(): ?string {
public function getCircleId(): string {
return $this->getCircleUniqueId();
}

Expand Down Expand Up @@ -200,11 +200,11 @@ public function getUserFavoritePages(): array {
return $this->userFavoritePages;
}

public function getCanLeave(): ?bool {
public function getCanLeave(): bool {
return $this->canLeave;
}

public function setCanLeave(?bool $canLeave): void {
public function setCanLeave(bool $canLeave): void {
$this->canLeave = $canLeave;
}

Expand Down
7 changes: 3 additions & 4 deletions lib/Db/CollectiveMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,17 @@
use OCA\Collectives\Service\NotFoundException;
use OCA\Collectives\Service\NotPermittedException;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Db\Entity;
use OCP\AppFramework\Db\MultipleObjectsReturnedException;
use OCP\AppFramework\Db\QBMapper;
use OCP\DB\Exception;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;

/**
* @method Collective insert(Entity $collective)
* @method Collective delete(Entity $collective)
* @method Collective insert(Collective $collective)
* @method Collective delete(Collective $collective)
* @method Collective findEntity(IQueryBuilder $query)
* @method Collective update(Entity $collective)
* @method Collective update(Collective $collective)
* @template-extends QBMapper<Collective>
*/
class CollectiveMapper extends QBMapper {
Expand Down
11 changes: 5 additions & 6 deletions lib/Db/PageMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,21 @@
namespace OCA\Collectives\Db;

use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Db\Entity;
use OCP\AppFramework\Db\MultipleObjectsReturnedException;
use OCP\AppFramework\Db\QBMapper;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;

/**
* @method Page insert(Entity $page)
* @method Page update(Entity $page)
* @method Page delete(Entity $page)
* @method Page insert(Page $page)
* @method Page update(Page $page)
* @method Page delete(Page $page)
* @method Page findEntity(IQueryBuilder $query)
* @template-extends QBMapper<Page>
*/
class PageMapper extends QBMapper {
public function __construct(IDBConnection $db, ?string $entityClass = null) {
parent::__construct($db, 'collectives_pages', $entityClass);
public function __construct(IDBConnection $db) {
parent::__construct($db, 'collectives_pages', Page::class);
}

public function updateOrInsert(Page $page): Page {
Expand Down
5 changes: 2 additions & 3 deletions lib/Team/CollectiveTeamResourceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function getSharedWith(string $teamId): array {

public function isSharedWithTeam(string $teamId, string $resourceId): bool {
$teamIds = $this->getTeamsForResource($resourceId);
return in_array($teamId, $teamIds);
return in_array($teamId, $teamIds, true);
}

public function getTeamsForResource(string $resourceId): array {
Expand All @@ -74,7 +74,6 @@ public function getTeamsForResource(string $resourceId): array {
} catch (NotFoundException|NotPermittedException) {
return [];
}
$circleId = $collective->getCircleId();
return $circleId === null ? [] : [$circleId];
return [$collective->getCircleId()];
}
}
Loading