Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin audit app: optimization according to PHP 8 #38176

Merged
merged 1 commit into from
Jul 5, 2023
Merged
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
8 changes: 3 additions & 5 deletions apps/admin_audit/lib/Actions/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@
use OCA\AdminAudit\IAuditLogger;

class Action {
/** @var IAuditLogger */
private $logger;

public function __construct(IAuditLogger $logger) {
$this->logger = $logger;
}
public function __construct(
private IAuditLogger $logger,
) {}

/**
* Log a single action with a log level of info
Expand All @@ -61,7 +59,7 @@
$this->logger->critical(
sprintf(
'$params["'.$element.'"] was missing. Transferred value: %s',
print_r($params, true)

Check failure on line 62 in apps/admin_audit/lib/Actions/Action.php

View workflow job for this annotation

GitHub Actions / static-code-analysis-security

TaintedHtml

apps/admin_audit/lib/Actions/Action.php:62:16: TaintedHtml: Detected tainted HTML (see https://psalm.dev/245)
),
['app' => 'admin_audit']
);
Expand Down
11 changes: 4 additions & 7 deletions apps/admin_audit/lib/BackgroundJobs/Rotate.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,12 @@
class Rotate extends TimedJob {
use RotationTrait;

/** @var IConfig */
private $config;

public function __construct(ITimeFactory $time,
IConfig $config) {
public function __construct(
ITimeFactory $time,
private IConfig $config,
) {
parent::__construct($time);

$this->config = $config;

$this->setInterval(60 * 60 * 3);
}

Expand Down
Loading