<commit_before># Michalmanko/Holiday
[![Build Status](https://travis-ci.org/michalmanko/php-library-holiday.svg?branch=master)](https://travis-ci.org/michalmanko/php-library-holiday)

Michalmanko/Holiday is a small library to check if a specified date is a holiday in a specific country.

## Requirements
Michalmanko/Holiday requires PHP 5.3.23 or later.

## Installation

### Composer
The easiest way to install this library is through [composer](http://getcomposer.org/). Just add the following lines to your **composer.json** file:

```json
{
   "require": {
        "michalmanko/php-library-holiday": "~0.1.1"
    }
}
```

### Manually
Another way would be to download this library and configure the autoloading yourself. This library relies on a [PSR-0](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md) compatible autoloader for automatic class loading.

## Usage

## Get a provider

```php
$providerByIso = \Michalmanko\Holiday\HolidayFactory::createProvider('PL');
$providerByCountry = \Michalmanko\Holiday\HolidayFactory::createProvider('Poland');
$providerByClassName = \Michalmanko\Holiday\HolidayFactory::createProvider('\\Michalmanko\\Holiday\\Provider\\Poland');
```

You can select provider by two-letter [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country codes, country name or just a class name.

## Check holidays

To check for holidays just create the provider for specific country and call the `getHolidays` method.

```php
$provider = \Michalmanko\Holiday\HolidayFactory::createProvider('PL');
$holidays = $adapter->getHolidays(new \DateTime('2014-01-01'));
```

If you just need to know if there is a holiday on your date or time period there are `isHoliday` and `hasHolidays` methods, too.
<commit_msg>change $adapter to $provider in docs<commit_after># Michalmanko/Holiday
[![Build Status](https://travis-ci.org/michalmanko/php-library-holiday.svg?branch=master)](https://travis-ci.org/michalmanko/php-library-holiday)

Michalmanko/Holiday is a small library to check if a specified date is a holiday in a specific country.

## Requirements
Michalmanko/Holiday requires PHP 5.3.23 or later.

## Installation

### Composer
The easiest way to install this library is through [composer](http://getcomposer.org/). Just add the following lines to your **composer.json** file:

```json
{
   "require": {
        "michalmanko/php-library-holiday": "~0.1.1"
    }
}
```

### Manually
Another way would be to download this library and configure the autoloading yourself. This library relies on a [PSR-0](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md) compatible autoloader for automatic class loading.

## Usage

## Get a provider

```php
$providerByIso = \Michalmanko\Holiday\HolidayFactory::createProvider('PL');
$providerByCountry = \Michalmanko\Holiday\HolidayFactory::createProvider('Poland');
$providerByClassName = \Michalmanko\Holiday\HolidayFactory::createProvider('\\Michalmanko\\Holiday\\Provider\\Poland');
```

You can select provider by two-letter [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country codes, country name or just a class name.

## Check holidays

To check for holidays just create the provider for specific country and call the `getHolidays` method.

```php
$provider = \Michalmanko\Holiday\HolidayFactory::createProvider('PL');
$holidays = $provider->getHolidays(new \DateTime('2014-01-01'));
```

If you just need to know if there is a holiday on your date or time period there are `isHoliday` and `hasHolidays` methods, too.

{'fraction_non_alphanumeric': 0.1287408243929983, 'fraction_numerical': 0.015245623941276116, 'mean_word_length': 5.025510204081633, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7261192', 'n_tokens_mistral': 1193, 'n_tokens_neox': 1115, 'n_words': 315}