aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/private/Metadata/Capabilities.php12
-rw-r--r--lib/private/Metadata/FileEventListener.php10
-rw-r--r--lib/private/Metadata/MetadataManager.php11
-rw-r--r--lib/private/Metadata/Provider/ExifProvider.php5
-rw-r--r--lib/private/Migration/BackgroundRepair.php18
-rw-r--r--lib/private/Migration/ConsoleOutput.php21
-rw-r--r--lib/private/Migration/SimpleOutput.php20
-rw-r--r--lib/private/Net/HostnameClassifier.php4
-rw-r--r--lib/private/Net/IpAddressClassifier.php4
9 files changed, 39 insertions, 66 deletions
diff --git a/lib/private/Metadata/Capabilities.php b/lib/private/Metadata/Capabilities.php
index 2fa0006f581..d8b0b82377e 100644
--- a/lib/private/Metadata/Capabilities.php
+++ b/lib/private/Metadata/Capabilities.php
@@ -26,15 +26,13 @@ use OCP\Capabilities\IPublicCapability;
use OCP\IConfig;
class Capabilities implements IPublicCapability {
- private IMetadataManager $manager;
- private IConfig $config;
-
- public function __construct(IMetadataManager $manager, IConfig $config) {
- $this->manager = $manager;
- $this->config = $config;
+ public function __construct(
+ private IMetadataManager $manager,
+ private IConfig $config,
+ ) {
}
- public function getCapabilities() {
+ public function getCapabilities(): array {
if ($this->config->getSystemValueBool('enable_file_metadata', true)) {
return ['metadataAvailable' => $this->manager->getCapabilities()];
}
diff --git a/lib/private/Metadata/FileEventListener.php b/lib/private/Metadata/FileEventListener.php
index 162e85ff3aa..5a1882ac0e4 100644
--- a/lib/private/Metadata/FileEventListener.php
+++ b/lib/private/Metadata/FileEventListener.php
@@ -39,12 +39,10 @@ use Psr\Log\LoggerInterface;
* @template-implements IEventListener<NodeWrittenEvent>
*/
class FileEventListener implements IEventListener {
- private IMetadataManager $manager;
- private LoggerInterface $logger;
-
- public function __construct(IMetadataManager $manager, LoggerInterface $logger) {
- $this->manager = $manager;
- $this->logger = $logger;
+ public function __construct(
+ private IMetadataManager $manager,
+ private LoggerInterface $logger,
+ ) {
}
private function shouldExtractMetadata(Node $node): bool {
diff --git a/lib/private/Metadata/MetadataManager.php b/lib/private/Metadata/MetadataManager.php
index 6d96ff1ab68..ef9f9200df7 100644
--- a/lib/private/Metadata/MetadataManager.php
+++ b/lib/private/Metadata/MetadataManager.php
@@ -24,17 +24,12 @@ use OCP\Files\File;
class MetadataManager implements IMetadataManager {
/** @var array<string, IMetadataProvider> */
- private array $providers;
- private array $providerClasses;
- private FileMetadataMapper $fileMetadataMapper;
+ private array $providers = [];
+ private array $providerClasses = [];
public function __construct(
- FileMetadataMapper $fileMetadataMapper
+ private FileMetadataMapper $fileMetadataMapper,
) {
- $this->providers = [];
- $this->providerClasses = [];
- $this->fileMetadataMapper = $fileMetadataMapper;
-
// TODO move to another place, where?
$this->registerProvider(ExifProvider::class);
}
diff --git a/lib/private/Metadata/Provider/ExifProvider.php b/lib/private/Metadata/Provider/ExifProvider.php
index b1598abbbc8..26edc6e01a0 100644
--- a/lib/private/Metadata/Provider/ExifProvider.php
+++ b/lib/private/Metadata/Provider/ExifProvider.php
@@ -28,12 +28,9 @@ use OCP\Files\File;
use Psr\Log\LoggerInterface;
class ExifProvider implements IMetadataProvider {
- private LoggerInterface $logger;
-
public function __construct(
- LoggerInterface $logger
+ private LoggerInterface $logger,
) {
- $this->logger = $logger;
}
public static function groupsProvided(): array {
diff --git a/lib/private/Migration/BackgroundRepair.php b/lib/private/Migration/BackgroundRepair.php
index 579ba494e58..f48a62131bd 100644
--- a/lib/private/Migration/BackgroundRepair.php
+++ b/lib/private/Migration/BackgroundRepair.php
@@ -41,15 +41,13 @@ use Psr\Log\LoggerInterface;
* @package OC\Migration
*/
class BackgroundRepair extends TimedJob {
- private IJobList $jobList;
- private LoggerInterface $logger;
- private IEventDispatcher $dispatcher;
-
- public function __construct(IEventDispatcher $dispatcher, ITimeFactory $time, LoggerInterface $logger, IJobList $jobList) {
+ public function __construct(
+ private IEventDispatcher $dispatcher,
+ ITimeFactory $time,
+ private LoggerInterface $logger,
+ private IJobList $jobList,
+ ) {
parent::__construct($time);
- $this->dispatcher = $dispatcher;
- $this->logger = $logger;
- $this->jobList = $jobList;
$this->setInterval(15 * 60);
}
@@ -58,7 +56,7 @@ class BackgroundRepair extends TimedJob {
* @throws \Exception
* @throws \OC\NeedsUpdateException
*/
- protected function run($argument) {
+ protected function run($argument): void {
if (!isset($argument['app']) || !isset($argument['step'])) {
// remove the job - we can never execute it
$this->jobList->remove($this, $this->argument);
@@ -101,7 +99,7 @@ class BackgroundRepair extends TimedJob {
* @param $app
* @throws NeedsUpdateException
*/
- protected function loadApp($app) {
+ protected function loadApp($app): void {
OC_App::loadApp($app);
}
}
diff --git a/lib/private/Migration/ConsoleOutput.php b/lib/private/Migration/ConsoleOutput.php
index 00b79f34866..841e3d302fc 100644
--- a/lib/private/Migration/ConsoleOutput.php
+++ b/lib/private/Migration/ConsoleOutput.php
@@ -34,14 +34,11 @@ use Symfony\Component\Console\Output\OutputInterface;
* @package OC\Migration
*/
class ConsoleOutput implements IOutput {
- /** @var OutputInterface */
- private $output;
+ private ?ProgressBar $progressBar = null;
- /** @var ProgressBar */
- private $progressBar;
-
- public function __construct(OutputInterface $output) {
- $this->output = $output;
+ public function __construct(
+ private OutputInterface $output,
+ ) {
}
public function debug(string $message): void {
@@ -51,21 +48,21 @@ class ConsoleOutput implements IOutput {
/**
* @param string $message
*/
- public function info($message) {
+ public function info($message): void {
$this->output->writeln("<info>$message</info>");
}
/**
* @param string $message
*/
- public function warning($message) {
+ public function warning($message): void {
$this->output->writeln("<comment>$message</comment>");
}
/**
* @param int $max
*/
- public function startProgress($max = 0) {
+ public function startProgress($max = 0): void {
if (!is_null($this->progressBar)) {
$this->progressBar->finish();
}
@@ -77,7 +74,7 @@ class ConsoleOutput implements IOutput {
* @param int $step
* @param string $description
*/
- public function advance($step = 1, $description = '') {
+ public function advance($step = 1, $description = ''): void {
if (is_null($this->progressBar)) {
$this->progressBar = new ProgressBar($this->output);
$this->progressBar->start();
@@ -88,7 +85,7 @@ class ConsoleOutput implements IOutput {
}
}
- public function finishProgress() {
+ public function finishProgress(): void {
if (is_null($this->progressBar)) {
return;
}
diff --git a/lib/private/Migration/SimpleOutput.php b/lib/private/Migration/SimpleOutput.php
index 6b0908500be..f1b06d008bb 100644
--- a/lib/private/Migration/SimpleOutput.php
+++ b/lib/private/Migration/SimpleOutput.php
@@ -33,12 +33,10 @@ use Psr\Log\LoggerInterface;
* @package OC\Migration
*/
class SimpleOutput implements IOutput {
- private LoggerInterface $logger;
- private $appName;
-
- public function __construct(LoggerInterface $logger, $appName) {
- $this->logger = $logger;
- $this->appName = $appName;
+ public function __construct(
+ private LoggerInterface $logger,
+ private $appName,
+ ) {
}
public function debug(string $message): void {
@@ -49,7 +47,7 @@ class SimpleOutput implements IOutput {
* @param string $message
* @since 9.1.0
*/
- public function info($message) {
+ public function info($message): void {
$this->logger->info($message, ['app' => $this->appName]);
}
@@ -57,7 +55,7 @@ class SimpleOutput implements IOutput {
* @param string $message
* @since 9.1.0
*/
- public function warning($message) {
+ public function warning($message): void {
$this->logger->warning($message, ['app' => $this->appName]);
}
@@ -65,7 +63,7 @@ class SimpleOutput implements IOutput {
* @param int $max
* @since 9.1.0
*/
- public function startProgress($max = 0) {
+ public function startProgress($max = 0): void {
}
/**
@@ -73,12 +71,12 @@ class SimpleOutput implements IOutput {
* @param string $description
* @since 9.1.0
*/
- public function advance($step = 1, $description = '') {
+ public function advance($step = 1, $description = ''): void {
}
/**
* @since 9.1.0
*/
- public function finishProgress() {
+ public function finishProgress(): void {
}
}
diff --git a/lib/private/Net/HostnameClassifier.php b/lib/private/Net/HostnameClassifier.php
index 626aa47083e..42dae790152 100644
--- a/lib/private/Net/HostnameClassifier.php
+++ b/lib/private/Net/HostnameClassifier.php
@@ -52,10 +52,6 @@ class HostnameClassifier {
* Check host identifier for local hostname
*
* IP addresses are not considered local. Use the IpAddressClassifier for those.
- *
- * @param string $hostname
- *
- * @return bool
*/
public function isLocalHostname(string $hostname): bool {
// Disallow local network top-level domains from RFC 6762
diff --git a/lib/private/Net/IpAddressClassifier.php b/lib/private/Net/IpAddressClassifier.php
index d4698864ec8..b012ca8e956 100644
--- a/lib/private/Net/IpAddressClassifier.php
+++ b/lib/private/Net/IpAddressClassifier.php
@@ -46,10 +46,6 @@ class IpAddressClassifier {
* Check host identifier for local IPv4 and IPv6 address ranges
*
* Hostnames are not considered local. Use the HostnameClassifier for those.
- *
- * @param string $ip
- *
- * @return bool
*/
public function isLocalAddress(string $ip): bool {
$parsedIp = Factory::parseAddressString(