2323use DatabaseBackup \Console \Command ;
2424use DatabaseBackup \Utility \BackupExport ;
2525use Exception ;
26+ use Tools \Filesystem ;
2627
2728/**
2829 * Exports a database backup
@@ -68,15 +69,16 @@ protected function buildOptionParser(ConsoleOptionParser $parser): ConsoleOption
6869 * This command uses `RotateCommand` and `SendCommand`.
6970 * @param \Cake\Console\Arguments $args The command arguments
7071 * @param \Cake\Console\ConsoleIo $io The console io
71- * @return int|null The exit code or null for success
72+ * @return void
7273 * @see https://github.com/mirko-pagliai/cakephp-database-backup/wiki/How-to-use-the-BackupShell#export
74+ * @throws \Cake\Console\Exception\StopException
7375 * @uses \DatabaseBackup\Command\RotateCommand::execute()
7476 * @uses \DatabaseBackup\Command\SendCommand::execute()
7577 * @uses \DatabaseBackup\Utility\BackupExport::compression()
7678 * @uses \DatabaseBackup\Utility\BackupExport::export()
7779 * @uses \DatabaseBackup\Utility\BackupExport::filename()
7880 */
79- public function execute (Arguments $ args , ConsoleIo $ io ): ? int
81+ public function execute (Arguments $ args , ConsoleIo $ io ): void
8082 {
8183 parent ::execute ($ args , $ io );
8284
@@ -93,7 +95,7 @@ public function execute(Arguments $args, ConsoleIo $io): ?int
9395
9496 //Exports
9597 $ file = $ instance ->export ();
96- $ io ->success (__d ('database_backup ' , 'Backup `{0}` has been exported ' , $ this -> Filesystem ->rtr ($ file )));
98+ $ io ->success (__d ('database_backup ' , 'Backup `{0}` has been exported ' , Filesystem:: instance () ->rtr ($ file )));
9799 $ verbose = $ args ->getOption ('verbose ' );
98100 $ quiet = $ args ->getOption ('quiet ' );
99101
@@ -120,7 +122,5 @@ public function execute(Arguments $args, ConsoleIo $io): ?int
120122 $ io ->error ($ e ->getMessage ());
121123 $ this ->abort ();
122124 }
123-
124- return null ;
125125 }
126126}
0 commit comments