aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/lib/Command/Object/Put.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/lib/Command/Object/Put.php')
-rw-r--r--apps/files/lib/Command/Object/Put.php14
1 files changed, 6 insertions, 8 deletions
diff --git a/apps/files/lib/Command/Object/Put.php b/apps/files/lib/Command/Object/Put.php
index dabc2b1ffc3..852d7c2225e 100644
--- a/apps/files/lib/Command/Object/Put.php
+++ b/apps/files/lib/Command/Object/Put.php
@@ -33,12 +33,10 @@ use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;
class Put extends Command {
- private ObjectUtil $objectUtils;
- private IMimeTypeDetector $mimeTypeDetector;
-
- public function __construct(ObjectUtil $objectUtils, IMimeTypeDetector $mimeTypeDetector) {
- $this->objectUtils = $objectUtils;
- $this->mimeTypeDetector = $mimeTypeDetector;
+ public function __construct(
+ private ObjectUtil $objectUtils,
+ private IMimeTypeDetector $mimeTypeDetector,
+ ) {
parent::__construct();
}
@@ -75,10 +73,10 @@ class Put extends Command {
$source = $inputName === '-' ? STDIN : fopen($inputName, 'r');
if (!$source) {
$output->writeln("<error>Failed to open $inputName</error>");
- return 1;
+ return self::FAILURE;
}
$objectStore->writeObject($object, $source, $this->mimeTypeDetector->detectPath($inputName));
- return 0;
+ return self::SUCCESS;
}
}