Various updates

This commit is contained in:
2023-06-08 20:49:27 -04:00
parent 3ed5acf75e
commit 9307ba330c
45 changed files with 864 additions and 188 deletions

View File

@ -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;
}
}
}