Pārlūkot izejas kodu

Merge pull request #38176 from danialRahimy/master

Admin audit app: optimization according to PHP 8
Arthur Schiwon 1 gadu atpakaļ
vecāks
revīzija
79d24bfb8e

+ 3 - 5
apps/admin_audit/lib/Actions/Action.php

@@ -31,12 +31,10 @@ 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,
+	) {}
 
 	/**
 	 * Log a single action with a log level of info

+ 4 - 7
apps/admin_audit/lib/BackgroundJobs/Rotate.php

@@ -35,15 +35,12 @@ use OCP\Log\RotationTrait;
 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);
 	}