PHPackages                             rapidwebltd/php-uk-bank-holidays - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. rapidwebltd/php-uk-bank-holidays

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rapidwebltd/php-uk-bank-holidays
================================

This library enables developers to easily retrieve UK Bank Holiday details. Holidays can be retrieved for England &amp; Wales, Scotland, and Northern Ireland. Information about these holidays can optionally be restricted by month or date.

v5.0.0(6y ago)12405.5k↓26%3[1 PRs](https://github.com/rapidwebltd/php-uk-bank-holidays/pulls)LGPL-3.0-onlyPHPPHP &gt;=5.6CI failing

Since Mar 13Pushed 4y ago5 watchersCompare

[ Source](https://github.com/rapidwebltd/php-uk-bank-holidays)[ Packagist](https://packagist.org/packages/rapidwebltd/php-uk-bank-holidays)[ RSS](/packages/rapidwebltd-php-uk-bank-holidays/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (15)Used By (0)

PHP UK Bank Holidays
====================

[](#php-uk-bank-holidays)

[![Build Status](https://camo.githubusercontent.com/324a9c04308418bc24c71dc9ed19c08ae3e04a21970184d4acf34d1c3ed00db0/68747470733a2f2f7472617669732d63692e6f72672f72617069647765626c74642f7068702d756b2d62616e6b2d686f6c69646179732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/rapidwebltd/php-uk-bank-holidays)[![Coverage Status](https://camo.githubusercontent.com/fd2cfad5068b33079d3bb511df5a3e93ae622ed2eeba52b3d10865a4d720eed0/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f72617069647765626c74642f7068702d756b2d62616e6b2d686f6c69646179732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/rapidwebltd/php-uk-bank-holidays?branch=master)[![StyleCI](https://camo.githubusercontent.com/acb125b8f4b310faddd84a92a3b62da85dffcf0fa233f99514277323b4d1d68d/68747470733a2f2f7374796c6563692e696f2f7265706f732f38343831323439342f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/84812494)[![Packagist](https://camo.githubusercontent.com/a156c458418047976a0c896971b164587f08e763434e6f38a2f7677a7acd55d0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72617069647765626c74642f7068702d756b2d62616e6b2d686f6c69646179732e737667)](https://packagist.org/packages/rapidwebltd/php-uk-bank-holidays/stats)

This library lets developers easily retrieve UK bank holiday details. Holidays can be retrieved for England &amp; Wales, Scotland, and Northern Ireland. Information about these holidays can optionally be restricted by month or date.

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

[](#installation)

To install, just run the following composer command.

`composer require rapidwebltd/php-uk-bank-holidays`

Remember to include the `vendor/autoload.php` file if your framework does not do this for you.

Usage
-----

[](#usage)

Retrieving bank holidays for a specific date can be done as follows. By default this will bring back holidays from England &amp; Wales.

```
use RapidWeb\UkBankHolidays\Factories\UkBankHolidayFactory;

$holidays = UkBankHolidayFactory::getByDate(2017, 01, 2);

var_dump($holidays);
```

### UKBankHoliday object

[](#ukbankholiday-object)

All `UkBankHolidayFactory` methods will return an array of `UkBankHoliday` objects. The following snippet shows an example object for the 2017 New Year's Day bank holiday, which occurs on the 2nd of January 2017.

```
array(1) {
  [0]=>
  object(RapidWeb\UkBankHolidays\Objects\UkBankHoliday)#46 (4) {
    ["title"]=>
    string(16) "New Year’s Day"
    ["date"]=>
    string(10) "2017-01-02"
    ["notes"]=>
    string(14) "Substitute day"
  }
}
```

This object contains a title for the holiday, the date it occurs, and government provided notes regarding the holiday, if available. All of these are publicly accessible.

### Location restriction

[](#location-restriction)

If you wish to retrieve bank holidays from Scotland or Northern Ireland, make use of the 4th optional argument, as follows.

```
$englandWalesHolidays = UkBankHolidayFactory::getByDate(2017, 01, 2, 'england-and-wales');
$scotlandHolidays = UkBankHolidayFactory::getByDate(2017, 01, 2, 'scotland');
$northernIrelandHolidays = UkBankHolidayFactory::getByDate(2017, 01, 2, 'northern-ireland');

$allHolidays = array_merge($englandWalesHolidays, $scotlandHolidays, $northernIrelandHolidays);
```

### Date-based restrictions

[](#date-based-restrictions)

You can use this library to retrieve all holidays or alternatively holidays restricted by month or date. This is easily done using the `getAll`, `getByMonth` and `getByDate` methods respectively.

See the following examples.

```
$allHolidays = UkBankHolidayFactory::getAll();
$januaryHolidays = UkBankHolidayFactory::getByMonth(2017, 01);
$newYearsHolidays = UkBankHolidayFactory::getByDate(2017, 01, 2);
```

All of these methods accept an additional optional argument to specify the location of the holidays you wish to retrieve. For more details, see the location restriction section above.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 61.9% 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 ~79 days

Recently: every ~179 days

Total

14

Last Release

2320d ago

Major Versions

v1.0.1 → v2.0.02017-03-27

v2.0.5 → v3.0.02018-01-26

v3.1.2 → v4.0.02018-12-15

v4.0.0 → v5.0.02020-01-11

PHP version history (2 changes)v1.0.0PHP &gt;=5.3

v4.0.0PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/c580cdf7c14898fff179cdfc1085892091d5d2f49d917873a12365af9ac77c93?d=identicon)[Jord-JD](/maintainers/Jord-JD)

---

Top Contributors

[![Jord-JD](https://avatars.githubusercontent.com/u/650645?v=4)](https://github.com/Jord-JD "Jord-JD (13 commits)")[![200MPH](https://avatars.githubusercontent.com/u/16258307?v=4)](https://github.com/200MPH "200MPH (3 commits)")[![ojdon](https://avatars.githubusercontent.com/u/1633249?v=4)](https://github.com/ojdon "ojdon (3 commits)")[![kirsty-gasston](https://avatars.githubusercontent.com/u/12949343?v=4)](https://github.com/kirsty-gasston "kirsty-gasston (2 commits)")

---

Tags

bank-holidaysphp-libraryretrieving-bank-holidaysuk-bank-holidaylibraryPHP Librarybank holidaysuk bank holidaysPHP uk bank holidays library

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rapidwebltd-php-uk-bank-holidays/health.svg)

```
[![Health](https://phpackages.com/badges/rapidwebltd-php-uk-bank-holidays/health.svg)](https://phpackages.com/packages/rapidwebltd-php-uk-bank-holidays)
```

###  Alternatives

[league/iso3166

ISO 3166-1 PHP Library

70036.3M116](/packages/league-iso3166)[niiknow/bayes

a machine learning lib

6950.0k](/packages/niiknow-bayes)[dekor/php-array-table

PHP Library for printing associative arrays as text table (similar to mysql terminal console)

296.6M2](/packages/dekor-php-array-table)

PHPackages © 2026

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