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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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:grab',
|
||||
@ -36,12 +37,12 @@ class GrabAttachments extends Command
|
||||
protected function getMessages(): array
|
||||
{
|
||||
$response = $this->getCommunicator()->get('/messages/pending');
|
||||
return \Safe\json_decode($response->getBody()->getContents())->messages;
|
||||
return json_decode($response->getBody()->getContents())->messages;
|
||||
}
|
||||
protected function grabAttachments(int $message_uid): int
|
||||
{
|
||||
$response = $this->getCommunicator()->put('/attachments/grab', ['messages' => [$message_uid]]);
|
||||
return \Safe\json_decode($response->getBody()->getContents())->attachment_count;
|
||||
return json_decode($response->getBody()->getContents())->attachment_count;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output): int
|
||||
@ -62,4 +63,4 @@ class GrabAttachments extends Command
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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: 'messages:grab',
|
||||
@ -36,12 +37,12 @@ class Messages extends Command
|
||||
protected function getMailboxes(): array
|
||||
{
|
||||
$response = $this->getCommunicator()->get('/mailboxes/registered');
|
||||
return \Safe\json_decode($response->getBody()->getContents())->mailboxes;
|
||||
return json_decode($response->getBody()->getContents())->mailboxes;
|
||||
}
|
||||
protected function grabMessages(string $mailbox): int
|
||||
{
|
||||
$response = $this->getCommunicator()->put('/messages/grab', ['mailboxes' => [$mailbox]]);
|
||||
$body = \Safe\json_decode($response->getBody()->getContents());
|
||||
$body = json_decode($response->getBody()->getContents());
|
||||
return $body->message_count;
|
||||
}
|
||||
|
||||
@ -63,4 +64,4 @@ class Messages extends Command
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user