Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Sysix/lexoffice-php-api
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.0.0
Choose a base ref
...
head repository: Sysix/lexoffice-php-api
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: development
Choose a head ref
Loading
Showing with 1,802 additions and 507 deletions.
  1. +6 −1 .gitattributes
  2. +18 −0 .github/PULL_REQUEST_TEMPLATE/FEATURE.md
  3. +21 −0 .github/workflows/codestyle.yml
  4. +37 −0 .github/workflows/coverage-report.yml
  5. +2 −2 .github/workflows/phpstan.yml
  6. +25 −0 .github/workflows/psalm.yml
  7. +1 −1 .github/workflows/tests.yml
  8. +14 −3 .gitignore
  9. +102 −0 .php-cs-fixer.dist.php
  10. +34 −0 Dockerfile
  11. +1 −1 LICENSE
  12. +128 −46 README.md
  13. +10 −4 composer.json
  14. +8 −0 docker-compose.yml
  15. +1 −1 phpstan.neon
  16. +26 −0 psalm.xml
  17. +75 −48 src/Api.php
  18. +8 −4 src/BaseClient.php
  19. +0 −8 src/ClientInterface.php
  20. +37 −0 src/Clients/Article.php
  21. +9 −2 src/Clients/Contact.php
  22. +4 −2 src/Clients/Country.php
  23. +7 −3 src/Clients/CreditNote.php
  24. +26 −0 src/Clients/DeliveryNote.php
  25. +4 −2 src/Clients/DownPaymentInvoice.php
  26. +19 −0 src/Clients/Dunning.php
  27. +5 −2 src/Clients/Event.php
  28. +17 −9 src/Clients/File.php
  29. +6 −2 src/Clients/Invoice.php
  30. +6 −2 src/Clients/OrderConfirmation.php
  31. +3 −1 src/Clients/Payment.php
  32. +4 −2 src/Clients/PaymentCondition.php
  33. +4 −2 src/Clients/PostingCategory.php
  34. +19 −0 src/Clients/PrintLayout.php
  35. +3 −2 src/Clients/Profile.php
  36. +4 −2 src/Clients/Quotation.php
  37. +3 −1 src/Clients/RecurringTemplate.php
  38. +5 −3 src/Clients/Traits/CreateFinalizeTrait.php
  39. +5 −3 src/Clients/Traits/CreateTrait.php
  40. +4 −3 src/Clients/Traits/DeleteTrait.php
  41. +8 −8 src/Clients/Traits/DocumentClientTrait.php
  42. +4 −2 src/Clients/Traits/GetTrait.php
  43. +23 −0 src/Clients/Traits/PursueFinalizeTrait.php
  44. +23 −0 src/Clients/Traits/PursueTrait.php
  45. +5 −3 src/Clients/Traits/UpdateTrait.php
  46. +5 −3 src/Clients/Traits/VoucherListTrait.php
  47. +11 −9 src/Clients/Voucher.php
  48. +5 −3 src/Clients/VoucherList.php
  49. +5 −3 src/Config/FileClient/VoucherConfig.php
  50. +4 −2 src/Config/FileClientConfig.php
  51. +4 −3 src/Exceptions/LexOfficeApiException.php
  52. +22 −0 src/Interfaces/ApiInterface.php
  53. +10 −0 src/Interfaces/ClientInterface.php
  54. +25 −16 src/PaginationClient.php
  55. +30 −23 src/Utils.php
  56. +34 −25 tests/ApiTest.php
  57. +105 −0 tests/Clients/ArticleTest.php
  58. +15 −11 tests/Clients/ContactTest.php
  59. +5 −3 tests/Clients/CountryTest.php
  60. +58 −23 tests/Clients/CreditNoteTest.php
  61. +161 −0 tests/Clients/DeliveryNoteTest.php
  62. +16 −15 tests/Clients/DownPaymentInvoiceTest.php
  63. +97 −0 tests/Clients/DunningTest.php
  64. +25 −9 tests/Clients/EventTest.php
  65. +35 −13 tests/Clients/FileTest.php
  66. +55 −21 tests/Clients/InvoiceTest.php
  67. +40 −23 tests/Clients/OrderConfirmationTest.php
  68. +5 −3 tests/Clients/PaymentConditionTest.php
  69. +5 −3 tests/Clients/PaymentTest.php
  70. +5 −3 tests/Clients/PostingCategoryTest.php
  71. +27 −0 tests/Clients/PrintLayoutTest.php
  72. +5 −3 tests/Clients/ProfileTest.php
  73. +20 −19 tests/Clients/QuotationTest.php
  74. +7 −5 tests/Clients/RecurringTemplateTest.php
  75. +7 −6 tests/Clients/VoucherListTest.php
  76. +21 −20 tests/Clients/VoucherTest.php
  77. +0 −8 tests/DeprecationException.php
  78. +25 −35 tests/PaginationClientTest.php
  79. +31 −14 tests/TestClient.php
  80. +0 −8 tests/Utils/WarningContainer.php
  81. +103 −0 tests/UtilsTest.php
7 changes: 6 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -3,4 +3,9 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/phpunit.xml export-ignore
/phpstan.neon export-ignore
/phpstan.neon export-ignore
/.php-cs-fixer.dist.php export-ignore
/psalm.xml export-ignore
/docker-compose.yml export-ignore
/Dockerfile export-ignore
/coverage.svg export-ignore
18 changes: 18 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/FEATURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: New Feature
labels: enhancement
---

## Requirements

- [ ] Updated README.md
- [ ] Add PHPUnit test
- [ ] Added related lexoffice documentation

## Description

Tell us about the new feature

## Related lexoffice documentation

<insert related lexoffice documentation link here>
21 changes: 21 additions & 0 deletions .github/workflows/codestyle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Run PHP-CS-Fixer

on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/cache@v3
with:
path: .php-cs-fixer.cache
key: ${{ runner.OS }}-${{ github.repository }}-phpcsfixer-${{ github.sha }}
restore-keys: |
${{ runner.OS }}-${{ github.repository }}-phpcsfixer-
- uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --diff --dry-run
37 changes: 37 additions & 0 deletions .github/workflows/coverage-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Coverage Report

on:
push:
branches: [ development ]

jobs:
coverage:
runs-on: ubuntu-latest

strategy:
fail-fast: true

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: xdebug

- name: Install dependencies
run: |
composer install --prefer-dist
- name: Execute tests with coverage
run: vendor/bin/phpunit --configuration 'phpunit.xml' --coverage-cobertura=coverage-cobertura.xml

- name: Make Coverage Badge
uses: action-badges/cobertura-coverage-xml-badges@0.3.0
with:
file-name: coverage.svg
badge-branch: badges
github-token: '${{ secrets.GITHUB_TOKEN }}'
coverage-file-name: ./coverage-cobertura.xml
4 changes: 2 additions & 2 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Shepherd
name: Run PHPStan

on: [pull_request]

@@ -12,6 +12,6 @@ jobs:
- uses: php-actions/phpstan@v3
with:
path: src/ tests/
level: 9
level: 10


25 changes: 25 additions & 0 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Run Psalm

on:
push:
branches: [ development ]
pull_request:
branches: [ development ]


jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- if: ${{ github.event_name == 'pull_request' }}
uses: docker://ghcr.io/psalm/psalm-github-actions
with:
composer_require_dev: true

- if: ${{ github.event_name != 'pull_request' }}
uses: docker://ghcr.io/psalm/psalm-github-actions
with:
composer_require_dev: true
args: --shepherd
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.3, 8.2, 8.1]
php: [8.4, 8.3, 8.2, 8.1]
dependency-version: [prefer-lowest, prefer-stable]

name: PHP${{ matrix.php }} - ${{ matrix.dependency-version }}
17 changes: 14 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/tests/cache/
/coverage*

# Created by https://www.toptal.com/developers/gitignore/api/windows,macos,linux,composer,phpunit,phpstorm+all,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=windows,macos,linux,composer,phpunit,phpstorm+all,visualstudiocode
# Created by https://www.toptal.com/developers/gitignore/api/windows,macos,linux,composer,phpunit,phpstorm+all,visualstudiocode,php-cs-fixer
# Edit at https://www.toptal.com/developers/gitignore?templates=windows,macos,linux,composer,phpunit,phpstorm+all,visualstudiocode,php-cs-fixer

### Composer ###
composer.phar
@@ -59,6 +60,16 @@ Temporary Items
# iCloud generated files
*.icloud

### PHP-CS-Fixer ###
# Covers PHP CS Fixer
# Reference: https://cs.symfony.com/

# Generated files
.php-cs-fixer.cache

# Local config See: https://cs.symfony.com/doc/config.html
.php-cs-fixer.php

### PhpStorm+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
@@ -207,4 +218,4 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/windows,macos,linux,composer,phpunit,phpstorm+all,visualstudiocode
# End of https://www.toptal.com/developers/gitignore/api/windows,macos,linux,composer,phpunit,phpstorm+all,visualstudiocode,php-cs-fixer
102 changes: 102 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<?php declare(strict_types=1);

$finder = PhpCsFixer\Finder::create()
->files()
->in(__DIR__ . '/src')
->in(__DIR__ . '/tests');

return (new PhpCsFixer\Config())
->setFinder($finder)
->setRiskyAllowed(true)
->setRules([
'@PSR12' => true,
'declare_strict_types' => true,
'modernize_types_casting' => true,
'multiline_comment_opening_closing' => true,
'multiline_whitespace_before_semicolons' => true,
'native_type_declaration_casing' => true,
'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha'],
'ordered_traits' => true,
'no_alias_functions' => true,
'no_alias_language_construct_call' => true,
'no_alternative_syntax' => true,
'no_binary_string' => true,
'no_blank_lines_after_phpdoc' => true,
'no_empty_comment' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => true,
'no_homoglyph_names' => true,
'no_leading_namespace_whitespace' => true,
'no_multiline_whitespace_around_double_arrow' => true,
'no_null_property_initialization' => true,
'no_short_bool_cast' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_around_offset' => true,
'no_superfluous_elseif' => true,
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
],
'no_trailing_comma_in_singleline' => true,
'no_trailing_whitespace_in_string' => true,
'no_unneeded_braces' => true,
'no_unneeded_control_parentheses' => true,
'no_unneeded_import_alias' => true,
'no_unset_cast' => true,
'no_unset_on_property' => true,
'no_unused_imports' => true,
'no_useless_concat_operator' => true,
'no_useless_else' => true,
'no_useless_nullsafe_operator' => true,
'no_useless_return' => true,
'no_whitespace_before_comma_in_array' => true,
'non_printable_character' => true,
'normalize_index_brace' => true,
'php_unit_set_up_tear_down_visibility' => true,
'php_unit_test_case_static_method_calls' => [
'call_type' => 'this',
],
'phpdoc_add_missing_param_annotation' => false,
'phpdoc_align' => true,
'phpdoc_annotation_without_dot' => true,
'phpdoc_indent' => true,
'phpdoc_inline_tag_normalizer' => true,
'phpdoc_no_access' => true,
'phpdoc_no_alias_tag' => true,
'phpdoc_no_empty_return' => true,
'phpdoc_no_package' => true,
'phpdoc_no_useless_inheritdoc' => true,
'phpdoc_order' => true,
'phpdoc_order_by_value' => [
'annotations' => [
'covers',
'dataProvider',
'throws',
'uses',
],
],
'phpdoc_param_order' => true,
'phpdoc_return_self_reference' => true,
'phpdoc_scalar' => true,
'phpdoc_separation' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_summary' => true,
'phpdoc_tag_casing' => true,
'phpdoc_tag_type' => true,
'phpdoc_to_comment' => false,
'phpdoc_trim' => true,
'simplified_null_return' => true,
'single_line_comment_spacing' => true,
'single_quote' => true,
'single_space_around_construct' => true,
'space_after_semicolon' => true,
'standardize_increment' => true,
'standardize_not_equals' => true,
'static_lambda' => true,
'strict_param' => true,
'string_length_to_empty'=> true,
'string_line_ending' => true,
'switch_continue_to_break' => true,
'trim_array_spaces' => true,
'whitespace_after_comma_in_array' => true,
])
->setLineEnding("\n");
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM php:8.2-fpm

ENV XDEBUG_MODE='coverage' \
XDEBUG_CONFIG='client_host=host.docker.internal output_dir=/var/www/tmp'

# install non php modules
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
libssl-dev \
libcurl4-openssl-dev \
libzip-dev \
libxml2-dev \
libonig-dev \
libc-client-dev \
libkrb5-dev \
zlib1g-dev \
zip \
unzip \
git \
&& rm -rf /var/lib/apt/lists/*

# Install PHP Extension for PHPUnit und Composer
RUN docker-php-ext-install \
zip \
mbstring \
xml \
curl

RUN pecl install xdebug \
&& docker-php-ext-enable xdebug;

COPY --from=composer /usr/bin/composer /usr/bin/composer

WORKDIR /var/www/html
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Sysix
Copyright (c) 2023-2025 Sysix

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Loading