diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml new file mode 100644 index 000000000..60ce66b64 --- /dev/null +++ b/.github/workflows/phpstan.yml @@ -0,0 +1,24 @@ +name: PHPStan + +on: [push] + +jobs: + phpstan: + name: phpstan + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + coverage: none + + - name: Install composer dependencies + run: composer install -n --prefer-dist + env: + COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }} + + - name: Run PHPStan + run: ./vendor/bin/phpstan --error-format=github diff --git a/README.md b/README.md index c5e440b6b..ad530d11c 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,28 @@ [![Tests](https://img.shields.io/github/actions/workflow/status/spatie/holidays/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/spatie/holidays/actions/workflows/run-tests.yml) [![Total Downloads](https://img.shields.io/packagist/dt/spatie/holidays.svg?style=flat-square)](https://packagist.org/packages/spatie/holidays) -This is where your description should go. Try and limit it to a paragraph or two. Consider adding a small example. +**THIS PACKAGE IS IN DEVELOPMENT, DON'T USE IT IN PRODUCTION (YET)** + +This package helps to calculate public holidays for a given country. + +At the moment only Belgium public holidays are supported. You can always send PR with your country. Don't forget to include tests. + +```php +use Spatie\Holidays\Holiday; + +$holidays = Holiday::all(); +``` + +Or for a specific country and year. + +```php +use Spatie\Holidays\Holiday; + +$holidays = Holiday::new() + ->forYear(2024) + ->forCountry('BE') + ->get(); +``` ## Support us @@ -22,13 +43,6 @@ You can install the package via composer: composer require spatie/holidays ``` -## Usage - -```php -$skeleton = new Spatie\Holidays(); -echo $skeleton->echoPhrase('Hello, Spatie!'); -``` - ## Testing ```bash diff --git a/tests/.pest/snapshots/HolidaysTest/it_can_get_all_holidays_of_2022.snap b/tests/.pest/snapshots/HolidaysTest/it_can_get_all_holidays_of_2022.snap deleted file mode 100644 index ff96a5106..000000000 --- a/tests/.pest/snapshots/HolidaysTest/it_can_get_all_holidays_of_2022.snap +++ /dev/null @@ -1,42 +0,0 @@ -[ - { - "name": "Nieuwjaar", - "date": "01-01-2022" - }, - { - "name": "Paasmaandag", - "date": "18-04-2022" - }, - { - "name": "Dag van de Arbeid", - "date": "01-05-2022" - }, - { - "name": "OH Hemelvaart", - "date": "26-05-2022" - }, - { - "name": "Pinkstermaandag", - "date": "06-06-2022" - }, - { - "name": "Nationale Feestdag", - "date": "21-07-2022" - }, - { - "name": "OLV Hemelvaart", - "date": "15-08-2022" - }, - { - "name": "Allerheiligen", - "date": "01-11-2022" - }, - { - "name": "Wapenstilstand", - "date": "11-11-2022" - }, - { - "name": "Kerstmis", - "date": "25-12-2022" - } -] \ No newline at end of file diff --git a/tests/HolidaysTest.php b/tests/HolidaysTest.php index 12d0769fa..a6e8529d7 100644 --- a/tests/HolidaysTest.php +++ b/tests/HolidaysTest.php @@ -12,14 +12,6 @@ expect($holidays)->toMatchSnapshot(); }); -it('can get all holidays of 2022', function () { - $holidays = Holidays::new() - ->year(2022) - ->get(); - - expect($holidays)->toMatchSnapshot(); -}); - it('can get all holidays of 2023', function () { $holidays = Holidays::new() ->year(2023)