mll-lab / holidays
PHP package to evaluate if a day is a holiday
Fund package maintenance!
mll-lab
Installs: 14 678
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^7.2 || ^8
- ext-calendar: *
- nesbot/carbon: ^2.53
- thecodingmachine/safe: ^1 || ^2
Requires (Dev)
- ergebnis/composer-normalize: ^2
- infection/infection: ~0.25
- jangregor/phpstan-prophecy: ^1
- phpstan/extension-installer: ^1
- phpstan/phpstan: ^1
- phpstan/phpstan-deprecation-rules: ^1
- phpstan/phpstan-phpunit: ^1
- phpstan/phpstan-strict-rules: ^1
- phpunit/phpunit: ^9 || ^10
- symfony/var-dumper: ^5 || ^6
- thecodingmachine/phpstan-safe-rule: ^1
README
Deprecated
This library is deprecated in favor of https://github.com/mll-lab/php-utils.
Installation
Install through composer
composer require mll-lab/holidays
Usage
use MLL\Holidays\BavarianHolidays; // Call static methods on BavarianHolidays
Custom Holidays
You can add custom holidays by registering a method that returns a map of holidays for a given year. Set this up in a central place that always runs before your application, e.g. a bootstrap method.
use MLL\Holidays\BavarianHolidays; BavarianHolidays::$loadUserDefinedHolidays = static function (int $year): array { switch ($year) { case 2019: return ['22.03' => 'Day of the Tentacle']; default: return []; } };
Custom holidays have precedence over the holidays inherent to this library.
Changelog
See CHANGELOG.md
.
Contributing
See CONTRIBUTING.md
.
License
This package is licensed using the MIT License.