diff options
Diffstat (limited to 'apps/admin_audit/lib/Actions/Action.php')
-rw-r--r-- | apps/admin_audit/lib/Actions/Action.php | 47 |
1 files changed, 11 insertions, 36 deletions
diff --git a/apps/admin_audit/lib/Actions/Action.php b/apps/admin_audit/lib/Actions/Action.php index 0eaf06b8c0f..acd415d82ea 100644 --- a/apps/admin_audit/lib/Actions/Action.php +++ b/apps/admin_audit/lib/Actions/Action.php @@ -1,41 +1,19 @@ <?php declare(strict_types=1); - /** - * @copyright Copyright (c) 2016 Lukas Reschke <lukas@statuscode.ch> - * - * @author Christoph Wurst <christoph@winzerhof-wurst.at> - * @author Joas Schilling <coding@schilljs.com> - * @author Lukas Reschke <lukas@statuscode.ch> - * @author Roeland Jago Douma <roeland@famdouma.nl> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * + * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ namespace OCA\AdminAudit\Actions; use OCA\AdminAudit\IAuditLogger; class Action { - /** @var IAuditLogger */ - private $logger; - public function __construct(IAuditLogger $logger) { - $this->logger = $logger; + public function __construct( + private IAuditLogger $logger, + ) { } /** @@ -47,23 +25,20 @@ class Action { * @param bool $obfuscateParameters */ public function log(string $text, - array $params, - array $elements, - bool $obfuscateParameters = false): void { + array $params, + array $elements, + bool $obfuscateParameters = false): void { foreach ($elements as $element) { if (!isset($params[$element])) { if ($obfuscateParameters) { $this->logger->critical( - '$params["'.$element.'"] was missing.', + '$params["' . $element . '"] was missing.', ['app' => 'admin_audit'] ); } else { $this->logger->critical( - sprintf( - '$params["'.$element.'"] was missing. Transferred value: %s', - print_r($params, true) - ), - ['app' => 'admin_audit'] + '$params["' . $element . '"] was missing. Transferred value: {params}', + ['app' => 'admin_audit', 'params' => $params] ); } return; |