babeuloula/adjacent-departments

Récupère la liste des départements limitrophes en fonction d'un département.

v1.0.2 2024-03-04 09:45 UTC

This package is auto-updated.

Last update: 2024-12-04 11:21:01 UTC


README

Récupère la liste des départements limitrophes en fonction d'un département.

Pré-requis

  • PHP >=7.3

Installation

composer require babeuloula/adjacent-departments

Utilisation

use BaBeuloula\AdjacentDepartments\AdjacentDepartments;

$adjacentDepartments = new AdjacentDepartments();
$adjacentDepartments->find('69'); // ['01','71','42','43','07','26','38']
$adjacentDepartments->isAdjacent('69', '75'); // false

Avec Symfony

use BaBeuloula\AdjacentDepartments\AdjacentDepartments;

$container
    ->get(AdjacentDepartments::class)
    ->find('69'); // ['01','71','42','43','07','26','38']

$container
    ->get(AdjacentDepartments::class)
    ->isAdjacent('69', '75'); // false