diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 8148c24..ed03ee6 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -16,11 +16,11 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.2' + php-version: '8.3' coverage: none - name: Install composer dependencies uses: ramsey/composer-install@v2 - name: Run PHPStan - run: ./vendor/bin/phpstan analyse src --error-format=github \ No newline at end of file + run: ./vendor/bin/phpstan analyse src --error-format=github diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index ae885d2..c26d8ea 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -15,11 +15,8 @@ jobs: matrix: os: [ ubuntu-latest, windows-latest ] php: [ 8.2, 8.3 ] - laravel: [ 10.* ] + laravel: [ 11.* ] stability: [ prefer-lowest, prefer-stable ] - include: - - laravel: 10.* - testbench: 8.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} @@ -41,7 +38,7 @@ jobs: - name: Install dependencies run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update composer update --${{ matrix.stability }} --prefer-dist --no-interaction - name: Set phpunit.xml diff --git a/.gitignore b/.gitignore index 83bc06d..1e71f2c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .php_cs .php_cs.cache .php-cs-fixer.cache +.phpunit.cache .phpunit.result.cache .DS_STORE build diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results new file mode 100644 index 0000000..5ecbb01 --- /dev/null +++ b/.phpunit.cache/test-results @@ -0,0 +1 @@ +{"version":"pest_2.34.6","defects":[],"times":{"P\\Tests\\Requests\\CompanyProfiles\\FetchAListOfCompanyProfilesRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Files\\GetASingleFileRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\AdditionalAddresses\\EditAnAdditionalAddressRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Salutations\\FetchASalutationRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Titles\\EditAnAdditionalAddressRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Currencies\\FetchExchangeRatesForCurrenciesRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Notes\\SearchNotesRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ManualEntries\\CreateManualEntryRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Payments\\DeleteAPaymentTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\AdditionalAddresses\\CreateAnAdditionalAddressRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactsRelations\\SearchContactRelationsRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\BankAccounts\\FetchASingleBankAccountRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Files\\FetchAListOfFilesRequestTest::__pest_evaluable_it_can_perform_the_request":0.003,"P\\Tests\\Requests\\VatPeriods\\FetchAListOfTaxesRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Contacts\\RestoreAContactRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\IbanPayments\\CreateIbanPaymentRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\ContactAdditionalAddresses\\DeleteAContactAdditionalAddressRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Taxes\\DeleteATaxRequestTest::__pest_evaluable_it_can_perform_the_request":0.003,"P\\Tests\\Requests\\Titles\\DeleteAnAdditonalAddressRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Payments\\FetchAListOfPaymentsTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\AdditionalAddresses\\FetchAListOfAdditionalAddressesRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\ContactsGroups\\SearchContactGroupsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Reports\\JournalRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Accounts\\FetchAListOfAccountsRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\QrPayments\\GetQrPaymentRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Contacts\\EditAContactRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Currencies\\EditACurrencyRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Contacts\\FetchAContactRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\CalendarYears\\CreateCalendarYearRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\ManualEntries\\GetNextReferenceNumberRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactsSectors\\SearchContactSectorsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactsGroups\\FetchAListOfContactGroupsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactsGroups\\EditAContactGroupRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\ManualEntries\\AddFileToAccountingEntryLineRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Currencies\\FetchAllPossibleCurrencyCodesRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Salutations\\EditASalutationRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\AdditionalAddresses\\DeleteAnAdditonalAddressRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Titles\\SearchTitlesRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Salutations\\FetchAListOfSalutationsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactsGroups\\FetchAContactGroupRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactsGroups\\DeleteAContactGroupRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\CalendarYears\\SearchCalendarYearsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Files\\SearchFilesRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Salutations\\SearchSalutationsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Files\\CreateAFileRequestTest::__pest_evaluable_it_can_perform_the_request":0.002,"P\\Tests\\Requests\\Files\\ShowFileUsageRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Taxes\\FetchATaxRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\CalendarYears\\FetchACalendarYearRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactsRelations\\EditAContactRelationRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Currencies\\DeleteACurrencyRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactAdditionalAddresses\\FetchAListOfContactAdditionalAddressRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\ContactsRelations\\DeleteAContactRelationRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\BankAccounts\\FetchAListOfBankAccountsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactAdditionalAddresses\\CreateContactAdditionalAddressRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Notes\\CreateANoteRequestTest::__pest_evaluable_it_can_perform_the_request":0.005,"P\\Tests\\Requests\\ContactsRelations\\CreateContactRelationRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactAdditionalAddresses\\EditAContactAdditionalAddressRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Payments\\CancelAPaymentTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Notes\\FetchAListOfNotesRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Contacts\\SearchContactsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactAdditionalAddresses\\FetchAContactAdditionalAddressRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Taxes\\FetchAListOfTaxesRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\IbanPayments\\GetIbanPaymentRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Titles\\CreateASalutationRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Currencies\\FetchACurrencyRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\CompanyProfiles\\FetchACompanyProfileRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\AccountGroups\\FetchAListOfAccountGroupsRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Accounts\\SearchAccountsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Notes\\FetchANoteRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\CalendarYears\\FetchAListOfCalendarYearsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\QrPayments\\CreateQrPaymentRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\ContactsGroups\\CreateContactGroupRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Contacts\\FetchAListOfContactsRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\ContactsRelations\\FetchAListOfContactRelationsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Contacts\\CreateContactRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Files\\DeleteAFileRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Salutations\\DeleteASalutationRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactsRelations\\FetchAContactRelationRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Notes\\DeleteANoteRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Contacts\\DeleteAContactRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Currencies\\FetchAListOfCurrenciesRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\ManualEntries\\FetchFileOfAccountingEntryLineRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Core\\ArchTest::__pest_evaluable_it_will_not_use_any_debug_function":0.17,"P\\Tests\\Requests\\Files\\GetAFilePreviewRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Files\\DownloadFIleRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\VatPeriods\\FetchATaxRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Notes\\EditANoteRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Titles\\FetchAListOfTitlesRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\BusinessYears\\FetchABusinessYearRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Salutations\\CreateASalutationRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\IbanPayments\\UpdateIbanPaymentRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\AdditionalAddresses\\SearchAdditionalAddressesRequestTest::__pest_evaluable_it_can_perform_the_request":0.024,"P\\Tests\\Requests\\Currencies\\CreateCurrencyRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Files\\EditAFileRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\AdditionalAddresses\\FetchAnAdditionalAddressRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ManualEntries\\DeleteFileOfAccountingEntryLineRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ManualEntries\\FetchAListOfManualEntriesRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactsSectors\\FetchAListOfContactSectorsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\QrPayments\\UpdateQrPaymentRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ManualEntries\\FetchFilesOfAccountingEntryRequestTest::__pest_evaluable_it_can_perform_the_request":0.001,"P\\Tests\\Requests\\Contacts\\BuilkCreateContactsRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\Titles\\FetchATitleRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\ContactAdditionalAddresses\\SearchContactAdditionalAddressRequestTest::__pest_evaluable_it_can_perform_the_request":0,"P\\Tests\\Requests\\BusinessYears\\FetchAListOfBusinessYearsRequestTest::__pest_evaluable_it_can_perform_the_request":0}} \ No newline at end of file diff --git a/composer.json b/composer.json index 1795839..4b4b459 100644 --- a/composer.json +++ b/composer.json @@ -1,82 +1,82 @@ { - "name": "codebar-ag/laravel-bexio", - "description": "Bexio integration with Laravel", - "keywords": [ - "bexio", - "laravel", - "codebar-ag", - "laravel-bexio" - ], - "homepage": "https://github.com/codebar-ag/laravel-bexio", - "license": "MIT", - "authors": [ - { - "name": "Sebastian Fix", - "email": "sebastian.fix@codebar.ch", - "homepage": "https://www.codebar.ch", - "role": "Developer" - }, - { - "name": "Rhys Lees", - "role": "Software-Developer" - } - ], - "require": { - "php": "^8.2", - "guzzlehttp/guzzle": "^7.8", - "laravel/framework": "^11", - "orchestra/testbench": "^9.0", - "saloonphp/cache-plugin": "^3.0", - "saloonphp/laravel-plugin": "^3.2", - "saloonphp/saloon": "^3.4", - "spatie/laravel-data": "^4.1", - "spatie/laravel-enum": "^3.0", - "spatie/laravel-package-tools": "^1.16" + "name": "codebar-ag/laravel-bexio", + "description": "Bexio integration with Laravel", + "keywords": [ + "bexio", + "laravel", + "codebar-ag", + "laravel-bexio" + ], + "homepage": "https://github.com/codebar-ag/laravel-bexio", + "license": "MIT", + "authors": [ + { + "name": "Sebastian Bürgin", + "email": "sebastian.buergin@codebar.ch", + "homepage": "https://www.codebar.ch", + "role": "Developer" }, - "require-dev": { - "laravel/pint": "^1.13", - "nunomaduro/collision": "^8.1", - "nunomaduro/larastan": "^2.8", - "orchestra/testbench": "^9.0", - "pestphp/pest": "^2.30", - "pestphp/pest-plugin-laravel": "^2.2", - "phpstan/extension-installer": "^1.3", - "phpstan/phpstan-deprecation-rules": "^1.1", - "phpstan/phpstan-phpunit": "^1.3", - "spatie/laravel-ray": "^1.33" - }, - "autoload": { - "psr-4": { - "CodebarAg\\Bexio\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "CodebarAg\\Bexio\\Tests\\": "tests" - } - }, - "scripts": { - "analyse": "vendor/bin/phpstan analyse", - "test": "vendor/bin/pest", - "test-coverage": "vendor/bin/pest --coverage", - "format": "vendor/bin/php-cs-fixer fix --allow-risky=yes" - }, - "config": { - "sort-packages": true, - "allow-plugins": { - "composer/package-versions-deprecated": false, - "pestphp/pest-plugin": true, - "phpstan/extension-installer": true, - "dealerdirect/phpcodesniffer-composer-installer": true - } - }, - "extra": { - "laravel": { - "providers": [ - "CodebarAg\\Bexio\\BexioServiceProvider" - ] - } - }, - "minimum-stability": "dev", - "prefer-stable": true + { + "name": "Rhys Lees", + "role": "Software-Developer" + } + ], + "require": { + "php": ">=8.2", + "guzzlehttp/guzzle": "^7.8", + "laravel/framework": "^11", + "illuminate/contracts": "^11.0", + "saloonphp/cache-plugin": "^3.0", + "saloonphp/laravel-plugin": "^3.2", + "saloonphp/saloon": "^3.4", + "spatie/laravel-data": "^4.4", + "spatie/laravel-enum": "^3.0", + "spatie/laravel-package-tools": "^1.16" + }, + "require-dev": { + "laravel/pint": "^1.13", + "nunomaduro/collision": "^8.1", + "larastan/larastan": "^2.8", + "orchestra/testbench": "^9.0", + "pestphp/pest": "^2.31", + "pestphp/pest-plugin-laravel": "^2.2", + "phpstan/extension-installer": "^1.3", + "phpstan/phpstan-deprecation-rules": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "spatie/laravel-ray": "^1.33" + }, + "autoload": { + "psr-4": { + "CodebarAg\\Bexio\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "CodebarAg\\Bexio\\Tests\\": "tests" + } + }, + "scripts": { + "analyse": "vendor/bin/phpstan analyse", + "test": "vendor/bin/pest", + "test-coverage": "vendor/bin/pest --coverage", + "format": "vendor/bin/php-cs-fixer fix --allow-risky=yes" + }, + "config": { + "sort-packages": true, + "allow-plugins": { + "composer/package-versions-deprecated": false, + "pestphp/pest-plugin": true, + "phpstan/extension-installer": true, + "dealerdirect/phpcodesniffer-composer-installer": true + } + }, + "extra": { + "laravel": { + "providers": [ + "CodebarAg\\Bexio\\BexioServiceProvider" + ] + } + }, + "minimum-stability": "dev", + "prefer-stable": true } diff --git a/src/BexioServiceProvider.php b/src/BexioServiceProvider.php index a015b50..5a4d90d 100644 --- a/src/BexioServiceProvider.php +++ b/src/BexioServiceProvider.php @@ -13,4 +13,14 @@ public function configurePackage(Package $package): void ->name('laravel-bexio') ->hasConfigFile('bexio'); } + + public function bootingPackage() + { + parent::bootingPackage(); // TODO: Change the autogenerated stub + + // Issue Temporary Fix: + // https://github.com/spatie/laravel-data/pull/699#issuecomment-1995546874 + // https://github.com/spatie/laravel-data/issues/731 + config()->set('data.throw_when_max_transformation_depth_reached', true); + } }