Various updates
This commit is contained in:
@ -1,12 +1,13 @@
|
||||
<?php
|
||||
namespace ProVM\Common\Command;
|
||||
|
||||
use ProVM\Common\Service\Communicator;
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use ProVM\Common\Service\Communicator;
|
||||
use function Safe\json_decode;
|
||||
|
||||
#[AsCommand(
|
||||
name: 'attachments:decrypt',
|
||||
@ -35,12 +36,12 @@ class DecryptPdf extends Command
|
||||
protected function getAttachments(): array
|
||||
{
|
||||
$response = $this->getCommunicator()->get('/attachments/pending');
|
||||
return \Safe\json_decode($response->getBody()->getContents())->attachments;
|
||||
return json_decode($response->getBody()->getContents())->attachments;
|
||||
}
|
||||
protected function decrypt(string $attachment): bool
|
||||
{
|
||||
$response = $this->getCommunicator()->put('/attachments/decrypt', ['attachments' => [$attachment]]);
|
||||
return \Safe\json_decode($response->getBody()->getContents())->status;
|
||||
return json_decode($response->getBody()->getContents())->status;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
@ -64,4 +65,4 @@ class DecryptPdf extends Command
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user