PHPackages                             urieldavid/desafio\_xlr8\_php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. urieldavid/desafio\_xlr8\_php

ActiveLibrary

urieldavid/desafio\_xlr8\_php
=============================

XLR8 Backend Interview

v2.2.0(2y ago)07MITPHPPHP ^8.1

Since May 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Uriel-David/Desafio_XLR8_PHP)[ Packagist](https://packagist.org/packages/urieldavid/desafio_xlr8_php)[ RSS](/packages/urieldavid-desafio-xlr8-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (6)Used By (0)

Backend Interview Challenge - XLR8/PHP
======================================

[](#backend-interview-challenge---xlr8php)

Project to develop PHP package for testing in XLR8. The project consists of creating a PHP library to consume the XLR8 API, and with that, through the coordinates of Latitude and Longitude, generate a list of hotels closest to you or cheaper.

Library Setup with Composer
---------------------------

[](#library-setup-with-composer)

```
composer require urieldavid/desafio_xlr8_php
```

After that, it is necessary to create the json, config.json in the root of the project, with valid endpoints to use the library, below is an example of the file:

```
{
    "source_1": "https://xlr8-interview-files.s3.eu-west-2.amazonaws.com/source_1.json",
    "source_2": "https://xlr8-interview-files.s3.eu-west-2.amazonaws.com/source_2.json"
}
```

Use the library
---------------

[](#use-the-library)

```
use XLR8\Exception\XLR8Exception;
use XLR8\Search;

require implode(DIRECTORY_SEPARATOR, [__DIR__, "vendor", "autoload.php"]);

try {
    $search = new Search();
    $search->getNearbyHotels(41.157944, -8.629105, "pricepernight");
} catch (XLR8Exception $e) {
    echo $e->getMessage();
}
```

OR

```
use XLR8\Exception\XLR8Exception;
use XLR8\Search;

require implode(DIRECTORY_SEPARATOR, [__DIR__, "vendor", "autoload.php"]);

try {
    $options = [
        'page' => 1,
        'limit' => 15,
        'responseJson' => false | true,
        'selectSource' => null | 'source_1' | 'any other endpoint in config.json'
    ];
    $search = new Search();
    $search->getNearbyHotels(41.157944, -8.629105, "pricepernight", $options);
} catch (XLR8Exception $e) {
    echo $e->getMessage();
}
```

Obs.:

- Default param required `getNearbyHotels($latitude, $longitude)`
- To set sort by `"pricepernight"` =&gt; `getNearbyHotels($latitude, $longitude, "pricepernight")`
- By default sorting is by `"proximity"`
- Param options:

    ```
        $options = [
            'page' => 1,
            'limit' => 15,
            'responseJson' => false | true,
            'selectSource' => null | 'source_1' | 'any other endpoint in config.json'
        ];
    ```

    Obs-1.: By default it will bring all the results, if you want pagination then you need to pass the values ​​in the options param, `$page => selected page` and `$limit => data limit per page`.

    Obs-2.: It is optional but there is the possibility of setting the information cache time, `new Search(3600);`, in this case 3600 seconds are equivalent to 1 hour, by default the cache is 1 day 42300 seconds.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~41 days

Total

5

Last Release

923d ago

Major Versions

v1.0.0 → v2.0.02023-10-31

### Community

Maintainers

![](https://www.gravatar.com/avatar/c7c26f9f88b00dd3099d2a23ee311c5e4d79a77beb25eb3658b367974bb99202?d=identicon)[UrielDavid](/maintainers/UrielDavid)

---

Top Contributors

[![Uriel-David](https://avatars.githubusercontent.com/u/62018939?v=4)](https://github.com/Uriel-David "Uriel-David (15 commits)")

### Embed Badge

![Health badge](/badges/urieldavid-desafio-xlr8-php/health.svg)

```
[![Health](https://phpackages.com/badges/urieldavid-desafio-xlr8-php/health.svg)](https://phpackages.com/packages/urieldavid-desafio-xlr8-php)
```

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k21](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
