You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: 'Update the last modified date of a file or folder, or create an empty file',
24
+
)]
25
+
class Touch {
22
26
publicfunction__construct(
23
27
privatereadonlyFileUtils$fileUtils,
24
28
privatereadonlyIRootFolder$rootFolder,
25
29
privatereadonlyClockInterface$clock,
26
30
) {
27
-
parent::__construct();
28
31
}
29
32
30
-
#[\Override]
31
-
protectedfunctionconfigure(): void {
32
-
$this
33
-
->setName('files:touch')
34
-
->setDescription('Update the last modified date of a file or folder, or create an empty file')
35
-
->addArgument('file', InputArgument::REQUIRED, 'Nextcloud path or fileid for the file or folder to change the modified date of')
36
-
->addOption('date', 'd', InputOption::VALUE_REQUIRED, 'Time to use as modified date instead of the current time. Acceptable formats are: ISO8601, "YYYY-MM-DD" and Unix time in seconds.')
37
-
->addOption('no-create', 'c', InputOption::VALUE_NONE, 'Don\'t create an empty file if the target path doesn\'t exist');
38
-
}
39
-
40
-
#[\Override]
41
-
publicfunctionexecute(InputInterface$input, OutputInterface$output): int {
42
-
$fileInput = $input->getArgument('file');
43
-
$node = $this->fileUtils->getNode($fileInput);
44
-
$date = $input->getOption('date');
45
-
$noCreate = $input->getOption('no-create');
33
+
publicfunction__invoke(
34
+
IOutput$output,
35
+
#[Argument(description: 'Nextcloud path or fileid for the file or folder to change the modified date of')]
36
+
string$file,
37
+
#[Option(name: 'no-create', description: 'Don\'t create an empty file if the target path doesn\'t exist', shortcut: 'c')]
38
+
bool$noCreate = false,
39
+
#[Option(description: 'Time to use as modified date instead of the current time. Acceptable formats are: ISO8601, "YYYY-MM-DD" and Unix time in seconds.', shortcut: 'd')]
0 commit comments