Skip to content

Commit

Permalink
Document holidays
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia committed Feb 1, 2024
1 parent 063e30d commit f8fb22c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,26 @@ composer require mll-lab/php-utils

See [tests](tests).

### 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.

```php
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.

### PHPStan extension

This library provides a PHPStan extension that is either registered through [PHPStan Extension Installer](https://github.com/phpstan/extension-installer)
Expand Down

0 comments on commit f8fb22c

Please sign in to comment.