Create command to test getClosestOpenHubs. #652
This commit is contained in:
parent
b7159c127c
commit
85be728bf6
1 changed files with 45 additions and 0 deletions
45
src/Command/TestClosestOpenHubsCommand.php
Normal file
45
src/Command/TestClosestOpenHubsCommand.php
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
|
||||
namespace App\Command;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
use CrEOF\Spatial\PHP\Types\Geometry\Point;
|
||||
|
||||
use App\Service\MapTools;
|
||||
|
||||
class TestClosestOpenHubsCommand extends Command
|
||||
{
|
||||
$protected $maptools;
|
||||
|
||||
protected function configure()
|
||||
{
|
||||
$this->setName('test:closestopenhubs')
|
||||
->setDescription('Test the get closest open hubs service.')
|
||||
->setHelp('Test the get closese open hubs service.')
|
||||
->addArgument('long', InputArgument::REQUIRED, 'Longitude')
|
||||
->addArgument('lat', InputArgument::REQUIRED, 'Latitude');
|
||||
}
|
||||
|
||||
public function __construct(MapTools $maptools)
|
||||
{
|
||||
$this->maptools = $maptools;
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$long = $input->getArgument('long');
|
||||
$lat = $input->getArgument('lat');
|
||||
|
||||
$point = new Point($long, $lat);
|
||||
$this->maptools->getClosestOpenHubs();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in a new issue