rehnansilva / xlr8rms
XLR8 Backend Interview
dev-main
2022-11-21 17:13 UTC
Requires
- php: >=7.4
- guzzlehttp/guzzle: ~7.0
- illuminate/collections: ^8.83
Requires (Dev)
- larapack/dd: ^1.1
- mockery/mockery: ^1.5
- phpunit/phpunit: 9.5
README
"# xlr8rms"
use XLR8RMS\App\Enums\OrderBy;
use XLR8RMS\App\Repository\HotelAPIRepository;
use XLR8RMS\App\Service\HotelSearchService;
$sources = [
'https://xlr8-interview-files.s3.eu-west-2.amazonaws.com/source_1.json',
'https://xlr8-interview-files.s3.eu-west-2.amazonaws.com/source_2.json'
];
$repository = new HotelAPIRepository($sources);
$service = new HotelSearchService($repository);
$latitude = -0.13395249999996395;
$longitude = 67.25;
$nearbyHotels = $service->getNearbyHotels($latitude, $longitude, OrderBy::PRICE_PER_NIGHT);