Skip to content

Commit

Permalink
fix psalm issues and run cs:fix
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <[email protected]>
  • Loading branch information
julien-nc committed Oct 20, 2024
1 parent bab0a6f commit 21e4a4d
Show file tree
Hide file tree
Showing 14 changed files with 69 additions and 69 deletions.
72 changes: 36 additions & 36 deletions composer.lock

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

14 changes: 7 additions & 7 deletions lib/Activity/CospendProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ class CospendProvider implements IProvider {
private array $projectNames;

public function __construct(
private IURLGenerator $urlGenerator,
private ActivityManager $activityManager,
private IUserManager $userManager,
private IGroupManager $groupManager,
private IAppManager $appManager,
private IL10N $l10n,
private IURLGenerator $urlGenerator,
private ActivityManager $activityManager,
private IUserManager $userManager,
private IGroupManager $groupManager,
private IAppManager $appManager,
private IL10N $l10n,
private LocalProjectService $projectService,
private ?string $userId,
private ?string $userId,
) {
$this->projectNames = [];
if (!is_null($userId)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public function getProjectInfo(string $projectId): DataResponse {
#[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Projects'])]
#[SupportFederatedProject]
public function editProject(
string $projectId, ?string $name = null,
string $projectId, ?string $name = null,
?string $autoExport = null, ?string $currencyName = null, ?bool $deletionDisabled = null,
?string $categorySort = null, ?string $paymentModeSort = null, ?int $archivedTs = null,
): DataResponse {
Expand Down
6 changes: 3 additions & 3 deletions lib/Controller/OldApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ public function apiv2GetBills(string $token, ?int $lastchanged = null, ?int $del
#[CospendPublicAuth(minimumLevel: Application::ACCESS_LEVEL_MAINTAINER)]
#[BruteForceProtection(action: 'CospendPublicAddMember')]
public function apiAddMember(string $token, string $name,
float $weight = 1, int $active = 1, ?string $color = null): DataResponse {
float $weight = 1, int $active = 1, ?string $color = null): DataResponse {
$publicShareInfo = $this->localProjectService->getLinkShareInfoFromShareToken($token);
try {
$member = $this->localProjectService->createMember(
Expand Down Expand Up @@ -404,7 +404,7 @@ public function apiAddBill(string $token, ?string $date = null, ?string $what =
#[CORS]
#[NoCSRFRequired]
#[CospendUserPermissions(minimumLevel: Application::ACCESS_LEVEL_PARTICIPANT)]
public function apiPrivAddBill(string $projectId, ?string $date = null, ?string $what = null, ?int $payer = null,
public function apiPrivAddBill(string $projectId, ?string $date = null, ?string $what = null, ?int $payer = null,
?string $payed_for = null, ?float $amount = null, string $repeat = 'n',
?string $paymentmode = null, ?int $paymentmodeid = null,
?int $categoryid = null, int $repeatallactive = 0, ?string $repeatuntil = null, ?int $timestamp = null,
Expand Down Expand Up @@ -448,7 +448,7 @@ public function apiRepeatBill(string $token, int $billId): DataResponse {
#[CospendPublicAuth(minimumLevel: Application::ACCESS_LEVEL_PARTICIPANT)]
#[BruteForceProtection(action: 'CospendPublicEditBill')]
public function apiEditBill(
string $token, int $billid, ?string $date = null, ?string $what = null,
string $token, int $billid, ?string $date = null, ?string $what = null,
?int $payer = null, ?string $payed_for = null, ?float $amount = null, string $repeat = 'n',
?string $paymentmode = null, ?int $paymentmodeid = null,
?int $categoryid = null, ?int $repeatallactive = null,
Expand Down
16 changes: 8 additions & 8 deletions lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@
class PageController extends Controller {

public function __construct(
string $appName,
IRequest $request,
private IL10N $trans,
string $appName,
IRequest $request,
private IL10N $trans,
private LocalProjectService $projectService,
private IInitialState $initialStateService,
private IAppManager $appManager,
private IEventDispatcher $eventDispatcher,
private IConfig $config,
private ?string $userId,
private IInitialState $initialStateService,
private IAppManager $appManager,
private IEventDispatcher $eventDispatcher,
private IConfig $config,
private ?string $userId,
) {
parent::__construct($appName, $request);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/PublicApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public function publicGetProjectInfo(string $token): DataResponse {
#[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Public-API_Projects'])]
public function publicGetProjectStatistics(
string $token, ?int $tsMin = null, ?int $tsMax = null,
?int $paymentModeId = null, ?int $categoryId = null,
?int $paymentModeId = null, ?int $categoryId = null,
?float $amountMin = null, ?float $amountMax = null,
string $showDisabled = '1', ?int $currencyId = null, ?int $payerId = null,
): DataResponse {
Expand Down Expand Up @@ -894,7 +894,7 @@ public function publicCreateCategory(string $token, string $name, ?string $icon,
#[BruteForceProtection(action: 'CospendPublicEditCat')]
#[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT, tags: ['Public-API_Categories'])]
public function publicEditCategory(
string $token, int $categoryId,
string $token, int $categoryId,
?string $name = null, ?string $icon = null, ?string $color = null,
): DataResponse {
try {
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/BillMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ public function getBillsToRepeat(?int $billId = null): array {
* @throws \OCP\DB\Exception
*/
public function getBillsClassic(
string $projectId, ?int $tsMin = null, ?int $tsMax = null,
string $projectId, ?int $tsMin = null, ?int $tsMax = null,
?string $paymentMode = null, ?int $paymentModeId = null,
?int $category = null, ?float $amountMin = null, ?float $amountMax = null,
?int $lastchanged = null, ?int $limit = null,
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __construct() {
$this->addType('name', 'string');
$this->addType('color', 'string');
$this->addType('encoded_icon', 'string');
$this->addType('order', 'int');
$this->addType('order', 'integer');
}

public function jsonSerialize(): array {
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/Invitation.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Invitation extends Entity implements \JsonSerializable {

public function __construct() {
$this->addType('userId', 'string');
$this->addType('state', 'int');
$this->addType('state', 'integer');
$this->addType('accessToken', 'string');
$this->addType('remoteProjectId', 'string');
$this->addType('remoteProjectName', 'string');
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/PaymentMode.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct() {
$this->addType('name', 'string');
$this->addType('color', 'string');
$this->addType('encoded_icon', 'string');
$this->addType('order', 'int');
$this->addType('order', 'integer');
$this->addType('old_id', 'string');
}

Expand Down
10 changes: 5 additions & 5 deletions lib/Search/CospendSearchProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@
class CospendSearchProvider implements IProvider {

public function __construct(
private IAppManager $appManager,
private IL10N $l10n,
private IURLGenerator $urlGenerator,
private IDateTimeFormatter $dateFormatter,
private IAppManager $appManager,
private IL10N $l10n,
private IURLGenerator $urlGenerator,
private IDateTimeFormatter $dateFormatter,
private LocalProjectService $projectService,
private BillMapper $billMapper,
private BillMapper $billMapper,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Service/FederatedProjectService.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public function getProjectSettlement(string $projectId, ?int $centeredOn = null,
}

public function editProject(
string $projectId, ?string $name = null, ?string $contact_email = null,
string $projectId, ?string $name = null, ?string $contact_email = null,
?string $autoExport = null, ?string $currencyName = null, ?bool $deletionDisabled = null,
?string $categorySort = null, ?string $paymentModeSort = null, ?int $archivedTs = null,
): void {
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/IProjectService.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function editMember(
* @return void
*/
public function editProject(
string $projectId, ?string $name = null, ?string $contact_email = null,
string $projectId, ?string $name = null, ?string $contact_email = null,
?string $autoExport = null, ?string $currencyName = null, ?bool $deletionDisabled = null,
?string $categorySort = null, ?string $paymentModeSort = null, ?int $archivedTs = null,
): void;
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/LocalProjectService.php
Original file line number Diff line number Diff line change
Expand Up @@ -1396,7 +1396,7 @@ public function editMember(
}

public function editProject(
string $projectId, ?string $name = null, ?string $contact_email = null,
string $projectId, ?string $name = null, ?string $contact_email = null,
?string $autoExport = null, ?string $currencyName = null, ?bool $deletionDisabled = null,
?string $categorySort = null, ?string $paymentModeSort = null, ?int $archivedTs = null,
): void {
Expand Down

0 comments on commit 21e4a4d

Please sign in to comment.