for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Location\Formatter\Coordinate;
use Location\Coordinate;
/**
* GeoJSON Coordinate Formatter
*
* @author Marcus Jaschen <[email protected]>
*/
class GeoJSON implements FormatterInterface
{
* @param Coordinate $coordinate
* @return string
public function format(Coordinate $coordinate): string
return json_encode(
[
'type' => 'Point',
'coordinates' => [
$coordinate->getLng(),
$coordinate->getLat(),
],
]
);
}