Skip to content

Commit 7bf9ab8

Browse files
Make US and Sweden work
- Refactor test structure - Add docker config for testing - Extend README
1 parent 3164bcd commit 7bf9ab8

File tree

202 files changed

+2495
-394
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+2495
-394
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
vendor
2-
composer.lock
32

README.MD

+21
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11
# libholiday - A PHP Holiday Library
22
With this library you can check if a given day is a holiday in selected country or state.
33

4+
## Usage Example
5+
6+
```
7+
Create instance of CalculatorService:
8+
$holidayService = new CalculatorService();
9+
10+
// Get actual calculator by passing country and optional state
11+
$calculator = $holidayService->getCalculatorByCountryAndState('DE', 'BY');
12+
13+
```
14+
15+
## Run tests
16+
You need to have docker installed. Please run:
17+
18+
This starts the container:
19+
`docker compose up -d`
20+
21+
This runs the tests:
22+
`docker compose exec php /var/app/vendor/bin/phpunit --configuration=/var/app/phpunit.xml`
23+
24+
425
## Todos
526
* Tests for special holidays like "Tourist Trophy Senior Race Day" on Isle of Man, see Belgium
627
* Translations for holidays

composer.json

+27-17
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,30 @@
11
{
2-
"name": "mayflower/holiday",
3-
"description": "A library to calculate holidays",
4-
"type": "library",
5-
"license": "LGPL-3.0+",
6-
"authors": [{
7-
"name": "David Soria Parra",
8-
"email": "[email protected]",
9-
"role": "Developer"
10-
}],
11-
"autoload": {
12-
"psr-0": {"Holiday": "src/"}
13-
},
14-
"require": {
15-
"php": ">= 5.4"
16-
},
17-
"require-dev": {
18-
"phpunit/phpunit": "~4.0"
2+
"name": "mayflower/holiday",
3+
"description": "A library to calculate holidays",
4+
"type": "library",
5+
"license": "LGPL-3.0+",
6+
"authors": [
7+
{
8+
"name": "David Soria Parra",
9+
"email": "[email protected]",
10+
"role": "Developer"
1911
}
12+
],
13+
"autoload": {
14+
"psr-0": {
15+
"Holiday": "src/"
16+
}
17+
},
18+
"autoload-dev": {
19+
"psr-4": {
20+
"Tests\\": "tests/"
21+
}
22+
},
23+
"require": {
24+
"php": ">= 7.4",
25+
"ext-calendar": "*"
26+
},
27+
"require-dev": {
28+
"phpunit/phpunit": "~9.5.17.0"
29+
}
2030
}

0 commit comments

Comments
 (0)