nextcloud / forms

📝 Simple form & survey app for Nextcloud
https://apps.nextcloud.com/apps/forms
GNU Affero General Public License v3.0
316 stars 97 forks source link

chore: unify __construct functions #2270

Closed Chartman123 closed 1 month ago

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 66.66667% with 5 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@9729865). Learn more about missing BASE report.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2270 +/- ## ======================================= Coverage ? 45.05% Complexity ? 813 ======================================= Files ? 68 Lines ? 3072 Branches ? 0 ======================================= Hits ? 1384 Misses ? 1688 Partials ? 0 ```
Chartman123 commented 1 month ago

I also tried to do it for the DB classes but got lots of errors so I left them as they are for now

Chartman123 commented 1 month ago

@susnux I saw some errors like this one:

TypeError Cannot assign null to property OCA\Forms\Activity\ActivityManager::$currentUser of type OCP\IUser (OCA\Forms\Activity\ActivityManager->__construct())

It's coming from this line: $this->currentUser = $userSession->getUser(); (48) in ConfigService.php and ActivityManager.php

However I wasn't able to reliably reproduce it. Do you know how to fix it? I tried it with adding an ? to private IUser $currentUser