2017 © Pedro Peláez
 

library php-uk-bank-holidays

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

image

rapidwebltd/php-uk-bank-holidays

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

  • Friday, March 16, 2018
  • by DivineOmega
  • Repository
  • 5 Watchers
  • 3 Stars
  • 48,926 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 13 Versions
  • 17 % Grown

The README.md

PHP UK Bank Holidays

Build Status Coverage Status StyleCI Packagist, (*1)

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

Installation

To install, just run the following composer command., (*3)

composer require rapidwebltd/php-uk-bank-holidays, (*4)

Remember to include the vendor/autoload.php file if your framework does not do this for you., (*5)

Usage

Retrieving bank holidays for a specific date can be done as follows. By default this will bring back holidays from England & Wales., (*6)

use RapidWeb\UkBankHolidays\Factories\UkBankHolidayFactory;

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

var_dump($holidays);

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., (*7)

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., (*8)

Location restriction

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

$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

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., (*10)

See the following examples., (*11)

$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., (*12)

The Versions

16/03 2018

dev-master

9999999-dev

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

  Sources   Download

LGPL3 LGPL-3.0-only

The Requires

 

The Development Requires

library php library bank holidays uk bank holidays php uk bank holidays library

16/03 2018

v3.1.1

3.1.1.0

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

  Sources   Download

LGPL-3.0-only

The Requires

 

The Development Requires

library php library bank holidays uk bank holidays php uk bank holidays library

16/03 2018

dev-analysis-z9VgKa

dev-analysis-z9VgKa

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

  Sources   Download

LGPL-3.0-only

The Requires

 

The Development Requires

library php library bank holidays uk bank holidays php uk bank holidays library

26/01 2018

v3.1.0

3.1.0.0

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

  Sources   Download

LGPL-3.0-only

The Requires

 

The Development Requires

library php library bank holidays uk bank holidays php uk bank holidays library

26/01 2018

v3.0.0

3.0.0.0

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

  Sources   Download

LGPL-3.0-only

The Requires

 

The Development Requires

library php library bank holidays uk bank holidays php uk bank holidays library

24/01 2018

v2.0.5

2.0.5.0

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

  Sources   Download

LGPL-3.0-only

The Requires

 

The Development Requires

library php library bank holidays uk bank holidays php uk bank holidays library

24/01 2018

v2.0.4

2.0.4.0

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

  Sources   Download

LGPL3

The Requires

 

The Development Requires

library php library bank holidays uk bank holidays php uk bank holidays library

11/01 2018

v2.0.3

2.0.3.0

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

  Sources   Download

LGPL3

The Requires

 

The Development Requires

library php library bank holidays uk bank holidays php uk bank holidays library

03/04 2017

v2.0.2

2.0.2.0

php uk bank holidays is a simple tool that allows you to retrive uk bank holidays in a easy to read format.

  Sources   Download

LGPL3

The Requires

 

library php library bank holidays uk bank holidays php uk bank holidays library

27/03 2017

v2.0.1

2.0.1.0

php uk bank holidays is a simple tool that allows you to retrive uk bank holidays in a easy to read format.

  Sources   Download

LGPL3

The Requires

 

library php library bank holidays uk bank holidays php uk bank holidays library

27/03 2017

v2.0.0

2.0.0.0

php uk bank holidays is a simple tool that allows you to retrive uk bank holidays in a easy to read format.

  Sources   Download

LGPL3

The Requires

 

library php library bank holidays uk bank holidays php uk bank holidays library

13/03 2017

v1.0.1

1.0.1.0

php uk bank holidays is a simple tool that allows you to retrive uk bank holidays in a easy to read format.

  Sources   Download

LGPL3

The Requires

 

library php library bank holidays uk bank holidays php uk bank holidays library

13/03 2017

v1.0.0

1.0.0.0

php uk bank holidays is a simple tool that allows you to retrive uk bank holidays in a easy to read format.

  Sources   Download

LGPL3

The Requires

 

library php library bank holidays uk bank holidays php uk bank holidays library