From a747233ffbe666ab43a0c26ed9d5cc2a820127fd Mon Sep 17 00:00:00 2001 From: Bas van Dinther Date: Fri, 30 Aug 2024 16:48:09 +0200 Subject: [PATCH] [Release] Upgrade API to v2 (#16) * Update package and PHP versions * Upgrade to v2 * Update README * Make rootcertificate nullable * Fix styling * Add more search options * Fix styling * Update README * Add PHPStan * Fix styling * Add upgrade docs --------- Co-authored-by: Baspa --- .github/workflows/phpstan.yml | 29 ++++++ .gitignore | 2 +- README.md | 46 +++++++-- composer.json | 5 +- docs/upgrade.md | 62 ++++++++++++ phpstan.neon.dist | 7 ++ src/Client.php | 177 ++++++++++++++++++++++++---------- src/ClientFactory.php | 18 ++-- src/Company/Address.php | 10 ++ src/Company/Company.php | 36 ++++--- 10 files changed, 311 insertions(+), 81 deletions(-) create mode 100644 .github/workflows/phpstan.yml create mode 100644 docs/upgrade.md create mode 100644 phpstan.neon.dist diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml new file mode 100644 index 0000000..3793d13 --- /dev/null +++ b/.github/workflows/phpstan.yml @@ -0,0 +1,29 @@ +name: PHPStan + +on: + pull_request: + paths: + - "**.php" + - "phpstan.neon.dist" + push: + branches: + - main + +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 + uses: ramsey/composer-install@v3 + + - name: Run PHPStan + run: ./vendor/bin/phpstan analyse --error-format=github --debug diff --git a/.gitignore b/.gitignore index 841e6e5..674fc48 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,4 @@ phpunit.xml psalm.xml vendor .php-cs-fixer.cache - +!docs \ No newline at end of file diff --git a/README.md b/README.md index 1050307..393a76a 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,12 @@ - # KvK API client (Dutch Chamber of Commerce) [![Latest Version on Packagist](https://img.shields.io/packagist/v/vormkracht10/kvk-api.svg?style=flat-square)](https://packagist.org/packages/vormkracht10/kvk-api) [![Tests](https://github.com/vormkracht10/kvk-api/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/vormkracht10/kvk-api/actions/workflows/run-tests.yml) [![Total Downloads](https://img.shields.io/packagist/dt/vormkracht10/kvk-api.svg?style=flat-square)](https://packagist.org/packages/vormkracht10/kvk-api) -PHP package to communicate with the business register of the Dutch Chamber of Commerce. +PHP package to communicate with the business register of the Dutch Chamber of Commerce. -At the moment it is only possible to search by company name. The result will contain the following data: +At the moment it is only possible to search by company name. The result will contain the following data: