PHPackages                             code2flourish/senregions - 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. code2flourish/senregions

ActiveLibrary

code2flourish/senregions
========================

Get all senegal regions and departments

1.1.0(5y ago)27MITPHP

Since Feb 14Pushed 5y agoCompare

[ Source](https://github.com/code2flourish/sen-regions)[ Packagist](https://packagist.org/packages/code2flourish/senregions)[ RSS](/packages/code2flourish-senregions/feed)WikiDiscussions main Synced 4d ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

[![Build Status](https://camo.githubusercontent.com/f04597a4a0fbf778bb343b9e665f6963c504c9f0cc53beb91c4b35c273015d24/68747470733a2f2f7472617669732d63692e6f72672f636f646532666c6f75726973682f73656e2d726567696f6e732e7376673f6272616e63683d6d61696e)](https://travis-ci.org/code2flourish/sen-regions)[![StyleCI](https://camo.githubusercontent.com/37f48dcdcb08c5aac5b8aa000c845ad1f09fc380949e249c3a317bd708336de7/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3333383836323739392f736869656c643f6272616e63683d6d61696e)](https://github.styleci.io/repos/338862799?branch=main)

Senegal Regions and Departments
===============================

[](#senegal-regions-and-departments)

Use this package if you want to have all the regions and departments in Senegal

Installation
------------

[](#installation)

Require the package using composer

```
composer require code2flourish/senregions
```

Usage
-----

[](#usage)

#### To get all regions

[](#to-get-all-regions)

```
use Code2Flourish\SenRegions\RegionFactory;
use Code2Flourish\SenRegions\Adapters\FileGetContentsWrapper;

$fileSystem = new FileGetContentsWrapper();
$factory = new RegionFactory($fileSystem);

$regions = $factory->getAll();
```

#### To get random region

[](#to-get-random-region)

```
use Code2Flourish\SenRegions\RegionFactory;
use Code2Flourish\SenRegions\Adapters\FileGetContentsWrapper;

$fileSystem = new FileGetContentsWrapper();
$factory = new RegionFactory($fileSystem);

$region = $factory->getRandomRegion();
```

#### To get all departments

[](#to-get-all-departments)

```
use Code2Flourish\SenRegions\DepartmentFactory;
use Code2Flourish\SenRegions\Adapters\FileGetContentsWrapper;

$fileSystem = new FileGetContentsWrapper();
$factory = new DepartmentFactory($fileSystem);

$departments = $factory->getAll();
```

#### To get all the departments of a region

[](#to-get-all-the-departments-of-a-region)

```
use Code2Flourish\SenRegions\DepartmentFactory;
use Code2Flourish\SenRegions\Adapters\FileGetContentsWrapper;

$fileSystem = new FileGetContentsWrapper();
$factory = new DepartmentFactory($fileSystem);

$departments = $factory->getAllByRegion(1);
```

✍🏾: The number passed in parameter represents the id of the region that you can find in the list of regions

#### To get random department

[](#to-get-random-department)

```
use Code2Flourish\SenRegions\DepartmentFactory;
use Code2Flourish\SenRegions\Adapters\FileGetContentsWrapper;

$fileSystem = new FileGetContentsWrapper();
$factory = new DepartmentFactory($fileSystem);

$department = $factory->getRandomDepartment();
```

Contributing
------------

[](#contributing)

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License
-------

[](#license)

[MIT](./LICENSE.md)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81% 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 ~0 days

Total

2

Last Release

1914d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/39a72207150c9d8a70c01e253db50f00377051bd7de937887078f6da8c10c398?d=identicon)[nangui](/maintainers/nangui)

---

Top Contributors

[![natheboy](https://avatars.githubusercontent.com/u/58434056?v=4)](https://github.com/natheboy "natheboy (17 commits)")[![nangui](https://avatars.githubusercontent.com/u/27294266?v=4)](https://github.com/nangui "nangui (4 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/code2flourish-senregions/health.svg)

```
[![Health](https://phpackages.com/badges/code2flourish-senregions/health.svg)](https://phpackages.com/packages/code2flourish-senregions)
```

PHPackages © 2026

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