Log commands

This commit is contained in:
2023-11-25 21:38:00 -03:00
parent ec4b16b2af
commit df679b2a1a
9 changed files with 39 additions and 57 deletions

View File

@ -1,21 +1,17 @@
<?php
namespace Incoviba\Command;
use Psr\Http\Client\ClientInterface;
use Symfony\Component\Console;
use Incoviba\Common\Alias\Command;
#[Console\Attribute\AsCommand(
name: 'comunas'
)]
class Comunas extends Console\Command\Command
class Comunas extends Command
{
public function __construct(protected ClientInterface $client, string $name = null)
{
parent::__construct($name);
}
public function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output)
public function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output)
{
$this->logger->debug("Running {$this->getName()}");
$uri = '/api/direcciones/region/13/comunas';
$output->writeln("GET {$uri}");
$response = $this->client->get($uri);