diff --git a/.gitignore b/.gitignore index 58969c4..91b23b2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,18 +1,12 @@ .idea -.php_cs -.php_cs.cache -.php-cs-fixer.cache .phpunit.result.cache -.phpunit.cache/ .phpunit.cache -.DS_STORE -build composer.lock coverage phpunit.xml -psalm.xml +phpstan.neon testbench.yaml vendor node_modules -phpstan.neon -/local +.phpactor.json +build diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php deleted file mode 100644 index 8d8a790..0000000 --- a/.php-cs-fixer.dist.php +++ /dev/null @@ -1,40 +0,0 @@ -in([ - __DIR__ . '/src', - __DIR__ . '/tests', - ]) - ->name('*.php') - ->notName('*.blade.php') - ->ignoreDotFiles(true) - ->ignoreVCS(true); - -return (new PhpCsFixer\Config()) - ->setRules([ - '@PSR12' => true, - 'array_syntax' => ['syntax' => 'short'], - 'ordered_imports' => ['sort_algorithm' => 'alpha'], - 'no_unused_imports' => true, - 'not_operator_with_successor_space' => true, - 'trailing_comma_in_multiline' => true, - 'phpdoc_scalar' => true, - 'unary_operator_spaces' => true, - 'binary_operator_spaces' => true, - 'blank_line_before_statement' => [ - 'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'], - ], - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_var_without_name' => true, - 'class_attributes_separation' => [ - 'elements' => [ - 'method' => 'one', - ], - ], - 'method_argument_space' => [ - 'on_multiline' => 'ensure_fully_multiline', - 'keep_multiple_spaces_after_comma' => true, - ], - 'single_trait_insert_per_statement' => true, - ]) - ->setFinder($finder); diff --git a/README.md b/README.md index b836b67..fe380ab 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,41 @@ -## Usage + + +[![Latest Version on Packagist](https://img.shields.io/packagist/v/codebar-ag/laravel-postfinance-b2b.svg?style=flat-square)](https://packagist.org/packages/codebar-ag/laravel-postfinance-b2b) +[![GitHub-Tests](https://github.com/codebar-ag/laravel-postfinance-b2b/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/codebar-ag/laravel-postfinance-b2b/actions/workflows/run-tests.yml) +[![GitHub Code Style](https://github.com/codebar-ag/laravel-postfinance-b2b/actions/workflows/fix-php-code-style-issues.yml/badge.svg?branch=main)](https://github.com/codebar-ag/laravel-postfinance-b2b/actions/workflows/fix-php-code-style-issues.yml) +[![Total Downloads](https://img.shields.io/packagist/dt/codebar-ag/laravel-postfinance-b2b.svg?style=flat-square)](https://packagist.org/packages/codebar-ag/laravel-postfinance-b2b) + +This package was developed to give you a quick start to communicate with the +PostFinance B2B REST API. + +## 💡 What is PostFinance B2B? + +PostFinance B2B is a digital interface for all your invoices +where you can send and receive your invoices electronically. + +## 🛠 Requirements + +| Package | PHP | Laravel | +|:-------:|:-----------:|:-------:| +| v12.0.0 | ^8.2 - ^8.4 | 12.x | +| v11.0.0 | ^8.2 - ^8.3 | 11.x | + +## ⚙️ Installation + +You can install the package via composer: + +```bash +composer require codebar-ag/laravel-postfinance-b2b +``` + +Add the following environment variables to your `.env` file: + +```bash +POSTFINANCE_B2B_USERNAME= +POSTFINANCE_B2B_PASSWORD= +``` + +## 🏗 Usage Invoice download web services provided by PostFinance diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 87d8e08..e64d8ee 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -9,5 +9,4 @@ parameters: tmpDir: build/phpstan checkOctaneCompatibility: true checkModelProperties: true - checkMissingIterableValueType: false - + noEnvCallsOutsideOfConfig: false diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 0b590da..5a32f80 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,7 +1,11 @@ - + - + tests @@ -16,6 +20,7 @@ +