Skip to content

Commit

Permalink
fix: Fix codacy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kumy committed Oct 25, 2023
1 parent f885a49 commit cd0a9d7
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private function render_response(\Base $f3, array $response) {
*/
public function request_s3_file_signature_api(\Base $f3) {
$this->set_response_content_type($f3);
$this->authenticate_via_secid($f3);
$this->authenticate_via_secid();
RateLimit::check_rate_limit_raw('API_V1_REQUEST_S3_FILE_SIGNATURE', $this->f3->get('REQUEST.secid'));
$data = $this->request_s3_file_signature($f3);
// Remove some dropzone internal headers on the public API
Expand All @@ -75,7 +75,7 @@ public function request_s3_file_signature_ajax(\Base $f3) {

private function request_s3_file_signature(\Base $f3) {
try {
$this->check_permission($f3);
$this->check_permission();
} catch (UploadPermissionException $e) {
http_response_code(403);
Error::buildError(true, [$e->getMessage()]);
Expand Down Expand Up @@ -193,5 +193,5 @@ abstract public function setRelationships(Picture $picture): void;
*
* @throws UploadPermissionException
*/
abstract protected function check_permission(\Base $f3);
abstract protected function check_permission();
}
4 changes: 2 additions & 2 deletions website/app/GeoKrety/Controller/Pages/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ public function loadCurrentUser() {
}
}

public function authenticate_via_secid(\Base $f3) {
public function authenticate_via_secid() {
$login = new Login();
$user = $login->secidAuth($this->f3, $this->f3->get('REQUEST.secid'));
$login->secidAuth($this->f3, $this->f3->get('REQUEST.secid'));
}

public function isLoggedIn(): bool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function setRelationships(Picture $picture): void {
*
* @throws UploadPermissionException
*/
protected function check_permission(\Base $f3): void {
protected function check_permission(): void {
if ($this->geokret->isOwner()) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion website/app/GeoKrety/Controller/Pages/MoveAvatarUpload.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function setRelationships(Picture $picture): void {
*
* @throws UploadPermissionException
*/
protected function check_permission(\Base $f3): void {
protected function check_permission(): void {
if ($this->hasWritePermission($this->move)) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion website/app/GeoKrety/Controller/Pages/UserAvatarUpload.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function setRelationships(Picture $picture): void {
*
* @throws UploadPermissionException
*/
protected function check_permission(\Base $f3): void {
protected function check_permission(): void {
if ($this->user->isCurrentUser()) {
return;
}
Expand Down
4 changes: 2 additions & 2 deletions website/app/GeoKrety/Service/Xml/Generic.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ public static function buildGeneric(bool $stream, string $root, array|string $da
$xml->addItem($k, $v);
}
$xml->xml->endElement();
} else {
$xml->addItem($key, $value);
continue;
}
$xml->addItem($key, $value);
}
$xml->end();
$xml->finish(); // may return raw gzipped data
Expand Down

0 comments on commit cd0a9d7

Please sign in to comment.