2828
2929use OC \Installer ;
3030use OCP \App \IAppManager ;
31- use OCP \ ILogger ;
31+ use Psr \ Log \ LoggerInterface ;
3232use Stecman \Component \Symfony \Console \BashCompletion \Completion \CompletionAwareInterface ;
3333use Stecman \Component \Symfony \Console \BashCompletion \CompletionContext ;
3434use Symfony \Component \Console \Command \Command ;
3939use Throwable ;
4040
4141class Remove extends Command implements CompletionAwareInterface {
42+ protected IAppManager $ manager ;
43+ private Installer $ installer ;
44+ private LoggerInterface $ logger ;
4245
43- /** @var IAppManager */
44- protected $ manager ;
45- /** @var Installer */
46- private $ installer ;
47- /** @var ILogger */
48- private $ logger ;
49-
50- /**
51- * @param IAppManager $manager
52- * @param Installer $installer
53- * @param ILogger $logger
54- */
55- public function __construct (IAppManager $ manager , Installer $ installer , ILogger $ logger ) {
46+ public function __construct (IAppManager $ manager , Installer $ installer , LoggerInterface $ logger ) {
5647 parent ::__construct ();
5748 $ this ->manager = $ manager ;
5849 $ this ->installer = $ installer ;
@@ -100,9 +91,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
10091 $ output ->writeln ($ appId . ' disabled ' );
10192 } catch (Throwable $ e ) {
10293 $ output ->writeln ('<error>Error: ' . $ e ->getMessage () . '</error> ' );
103- $ this ->logger ->logException ($ e , [
94+ $ this ->logger ->error ($ e-> getMessage () , [
10495 'app ' => 'CLI ' ,
105- 'level ' => ILogger:: ERROR
96+ 'exception ' => $ e ,
10697 ]);
10798 return 1 ;
10899 }
@@ -113,9 +104,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
113104 $ result = $ this ->installer ->removeApp ($ appId );
114105 } catch (Throwable $ e ) {
115106 $ output ->writeln ('<error>Error: ' . $ e ->getMessage () . '</error> ' );
116- $ this ->logger ->logException ($ e , [
107+ $ this ->logger ->error ($ e-> getMessage () , [
117108 'app ' => 'CLI ' ,
118- 'level ' => ILogger:: ERROR
109+ 'exception ' => $ e ,
119110 ]);
120111 return 1 ;
121112 }
0 commit comments