26 lines
723 B
PHP
26 lines
723 B
PHP
|
<?php
|
||
|
namespace Incoviba\Command;
|
||
|
|
||
|
use Psr\Http\Client\ClientInterface;
|
||
|
use Symfony\Component\Console;
|
||
|
|
||
|
#[Console\Attribute\AsCommand(
|
||
|
name: 'comunas'
|
||
|
)]
|
||
|
class Comunas extends Console\Command\Command
|
||
|
{
|
||
|
public function __construct(protected ClientInterface $client, string $name = null)
|
||
|
{
|
||
|
parent::__construct($name);
|
||
|
}
|
||
|
|
||
|
public function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output)
|
||
|
{
|
||
|
$uri = '/api/direcciones/region/13/comunas';
|
||
|
$output->writeln("GET {$uri}");
|
||
|
$response = $this->client->get($uri);
|
||
|
$output->writeln("Response Code: {$response->getStatusCode()}");
|
||
|
return Console\Command\Command::SUCCESS;
|
||
|
}
|
||
|
}
|