Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
/phpunit.xml.dist export-ignore
/rector.php export-ignore
/infection.json5 export-ignore
/lychee.toml export-ignore
/.roave-backward-compatibility-check.xml export-ignore
/.env.test export-ignore

Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Links

on:
pull_request:
paths: ['**.md', 'docs/**', 'src/**', 'tools/codegen/definitions/**', 'lychee.toml', '.github/workflows/links.yml']
push:
branches: [4.x]
paths: ['**.md', 'docs/**', 'src/**', 'tools/codegen/definitions/**', 'lychee.toml', '.github/workflows/links.yml']
# Wöchentlich, damit auch Links auffallen, die ohne Änderung bei uns kaputtgehen.
schedule:
- cron: '0 6 * * 1'
workflow_dispatch:

permissions:
contents: read

jobs:
lychee:
name: Check links
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7

- name: Restore lychee cache
uses: actions/cache@v6
with:
path: .lycheecache
key: lychee-${{ github.sha }}
restore-keys: lychee-

# Konfiguration in lychee.toml; das Token verhindert das GitHub-Rate-Limit für github.com-Links.
- name: Check links
uses: lycheeverse/lychee-action@v2
with:
args: --no-progress --config lychee.toml 'docs/**/*.md' '*.md' 'src/**/*.php' 'tools/codegen/definitions/*.php'
fail: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ Thumbs.db
/docs/node_modules/
/docs/.vitepress/cache/
/docs/.vitepress/dist/
.lycheecache
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ CI runs via `.github/workflows/ci.yml` on PHP 8.5 (required) and 8.6 (experiment

### Documentation website

`docs/` is also a VitePress site (`docs/.vitepress/config.mts`, `docs/package.json`, `cd docs && npm ci && npm run build`), deployed by `.github/workflows/docs.yml` to https://billomat-php.justpilot.io (`docs/public/CNAME`). The sidebar is built from the first `# ` heading of each page; `docs/spec/`, `docs/audit.md` and `docs/roadmap-v4.md` are excluded. Relative links to files outside `docs/` are rewritten to GitHub. Dead links fail the build. The "JSON on the wire" sections between the `json-examples` markers are generated by `tools/generate-json-examples.php` (request bodies captured from the SDK into `docs/snippets/json/`, responses imported from the contract fixtures); never edit them by hand, add a request or page in the tool and run `composer docs:json`.
`docs/` is also a VitePress site (`docs/.vitepress/config.mts`, `docs/package.json`, `cd docs && npm ci && npm run build`), deployed by `.github/workflows/docs.yml` to https://billomat-php.justpilot.io (`docs/public/CNAME`). The sidebar is built from the first `# ` heading of each page; `docs/spec/`, `docs/audit.md` and `docs/roadmap-v4.md` are excluded. Relative links to files outside `docs/` are rewritten to GitHub. Dead links fail the build; external links (docs, root Markdown, docblocks) are checked by lychee in `.github/workflows/links.yml` (config `lychee.toml`, also weekly). The "JSON on the wire" sections between the `json-examples` markers are generated by `tools/generate-json-examples.php` (request bodies captured from the SDK into `docs/snippets/json/`, responses imported from the contract fixtures); never edit them by hand, add a request or page in the tool and run `composer docs:json`.

## Architecture

Expand Down
3 changes: 2 additions & 1 deletion docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ PHPStan runs without a baseline: every finding fails CI and is fixed in the code
2. **PSR-18 compat** — a smoke test with Guzzle and without Symfony (`.github/compat/guzzle`).
3. **Quality** — `composer lint`, `composer analyse`, `composer refactor:dry`, `composer generate:check`, `composer audit`.
4. **Backward compatibility** — [`roave/backward-compatibility-check`](https://github.com/Roave/BackwardCompatibilityCheck) compares the public API against the latest `v4.*` tag. Accepted findings go into `.roave-backward-compatibility-check.xml`. Until 4.0.0-beta.1 the job is informational (`continue-on-error`).
5. **Mutation testing** — on PRs only the changed lines (`--git-diff-lines`, 90 % MSI); on `main`/`4.x` the full run with the thresholds from `infection.json5`.
5. **Links** (`.github/workflows/links.yml`, separate workflow) — [lychee](https://lychee.cli.rs) checks the links in `docs/`, the root Markdown files and the Billomat links in the docblocks (`src/`, `tools/codegen/definitions/`), configured in `lychee.toml`. It also runs weekly to catch links that break without a change on our side.
6. **Mutation testing** — on PRs only the changed lines (`--git-diff-lines`, 90 % MSI); on `main`/`4.x` the full run with the thresholds from `infection.json5`.

To run the BC check locally, install the tool outside the project (it needs Symfony 7 components) and call it from the repository root:

Expand Down
28 changes: 28 additions & 0 deletions lychee.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Link-Check (lychee) für Doku, README, CHANGELOG und die Billomat-Links in den Docblocks.
# Läuft in .github/workflows/links.yml; lokal: lychee 'docs/**/*.md' '*.md' 'src/**/*.php' 'tools/codegen/definitions/*.php'

exclude_path = [
"docs/node_modules",
"docs/.vitepress",
"docs/spec",
"docs/audit.md",
"docs/roadmap-v4.md",
"vendor",
"build",
"graphify-out",
]

# Platzhalter aus Beispielen, keine echten Ziele.
exclude = [
'^https?://([a-z0-9-]+\.)?example\.(com|org|net)',
'^https?://mycompany\.billomat\.net',
'^https?://localhost',
]

max_concurrency = 8
max_retries = 3
# 429: der Server lebt, er drosselt nur.
accept = ["200..=299", "429"]

cache = true
max_cache_age = "1d"
2 changes: 1 addition & 1 deletion src/Api/ConfirmationCommentCreateOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Null-Werte bedeuten "nicht gesetzt" und werden beim Serialisieren ignoriert.
*
* Doku:
* https://www.billomat.com/en/api/confirmations/comments/
* https://www.billomat.com/api/auftragsbestaetigungen/
*
* Generiert aus tools/codegen/definitions/confirmation-comments.php – nicht von Hand bearbeiten,
* sondern die Definition anpassen und `composer generate` ausführen.
Expand Down
2 changes: 1 addition & 1 deletion src/Api/ConfirmationItemCreateOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Null-Werte bedeuten "nicht gesetzt" und werden beim Serialisieren ignoriert.
*
* Doku:
* https://www.billomat.com/en/api/confirmations/items/
* https://www.billomat.com/api/auftragsbestaetigungen/
*
* Generiert aus tools/codegen/definitions/confirmation-items.php – nicht von Hand bearbeiten,
* sondern die Definition anpassen und `composer generate` ausführen.
Expand Down
2 changes: 1 addition & 1 deletion src/Api/ConfirmationItemUpdateOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Billomat lässt nicht gesendete Felder unverändert.
*
* Doku:
* https://www.billomat.com/en/api/confirmations/items/
* https://www.billomat.com/api/auftragsbestaetigungen/
*
* Generiert aus tools/codegen/definitions/confirmation-items.php – nicht von Hand bearbeiten,
* sondern die Definition anpassen und `composer generate` ausführen.
Expand Down
2 changes: 1 addition & 1 deletion src/Api/ConfirmationTagCreateOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Typisierter Payload für POST /confirmation-tags gemäß Billomat-API.
*
* Doku:
* https://www.billomat.com/en/api/confirmations/tags/
* https://www.billomat.com/api/auftragsbestaetigungen/
*
* Generiert aus tools/codegen/definitions/confirmation-tags.php – nicht von Hand bearbeiten,
* sondern die Definition anpassen und `composer generate` ausführen.
Expand Down
2 changes: 1 addition & 1 deletion src/Api/DeliveryNoteCommentCreateOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Null-Werte bedeuten "nicht gesetzt" und werden beim Serialisieren ignoriert.
*
* Doku:
* https://www.billomat.com/en/api/delivery-notes/comments/
* https://www.billomat.com/api/lieferscheine/
*
* Generiert aus tools/codegen/definitions/delivery-note-comments.php – nicht von Hand bearbeiten,
* sondern die Definition anpassen und `composer generate` ausführen.
Expand Down
2 changes: 1 addition & 1 deletion src/Api/DeliveryNoteItemCreateOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Null-Werte bedeuten "nicht gesetzt" und werden beim Serialisieren ignoriert.
*
* Doku:
* https://www.billomat.com/en/api/delivery-notes/items/
* https://www.billomat.com/api/lieferscheine/
*
* Generiert aus tools/codegen/definitions/delivery-note-items.php – nicht von Hand bearbeiten,
* sondern die Definition anpassen und `composer generate` ausführen.
Expand Down
2 changes: 1 addition & 1 deletion src/Api/DeliveryNoteItemUpdateOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Billomat lässt nicht gesendete Felder unverändert.
*
* Doku:
* https://www.billomat.com/en/api/delivery-notes/items/
* https://www.billomat.com/api/lieferscheine/
*
* Generiert aus tools/codegen/definitions/delivery-note-items.php – nicht von Hand bearbeiten,
* sondern die Definition anpassen und `composer generate` ausführen.
Expand Down
2 changes: 1 addition & 1 deletion src/Api/InboxDocumentCreateOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* Payload für POST /inbox-documents.
*
* Doku: https://www.billomat.com/en/api/inbox-documents/
* Doku: https://www.billomat.com/api/eingangsrechnungen/inbox/
*/
final readonly class InboxDocumentCreateOptions implements WriteOptions
{
Expand Down
2 changes: 1 addition & 1 deletion src/Api/InboxDocumentsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/**
* API-Wrapper für Posteingangs-Dokumente (Inbox Documents).
*
* Doku: https://www.billomat.com/en/api/inbox-documents/
* Doku: https://www.billomat.com/api/eingangsrechnungen/inbox/
*
* Endpoints:
* - GET /inbox-documents
Expand Down
2 changes: 1 addition & 1 deletion src/Api/RecurringEmailReceiversApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* - PUT /recurring-email-receivers/{id}
* - DELETE /recurring-email-receivers/{id}
*
* Doku: https://www.billomat.com/api/abo-rechnungen/email-empfaenger/
* Doku: https://www.billomat.com/api/abo-rechnungen/empfaenger/
*
* @extends AbstractSubResourceApi<RecurringEmailReceiver>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Api/ReminderItemsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* - GET /reminder-items?reminder_id={id}
* - GET /reminder-items/{id}
*
* Doku: https://www.billomat.com/en/api/reminders/items/
* Doku: https://www.billomat.com/api/mahnungen/positionen/
*
* @extends AbstractSubResourceApi<ReminderItem>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Model/ConfirmationComment.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* enthält den ursprünglichen String aus der API.
*
* Dokumentation:
* https://www.billomat.com/en/api/confirmations/comments/
* https://www.billomat.com/api/auftragsbestaetigungen/
*
* Generiert aus tools/codegen/definitions/confirmation-comments.php – nicht von Hand bearbeiten,
* sondern die Definition anpassen und `composer generate` ausführen.
Expand Down
2 changes: 1 addition & 1 deletion src/Model/ConfirmationItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Dieses Model bildet die Struktur von GET /confirmation-items?confirmation_id={id} bzw. GET /confirmation-items/{id} ab.
*
* Dokumentation:
* https://www.billomat.com/en/api/confirmations/items/
* https://www.billomat.com/api/auftragsbestaetigungen/
*
* Generiert aus tools/codegen/definitions/confirmation-items.php – nicht von Hand bearbeiten,
* sondern die Definition anpassen und `composer generate` ausführen.
Expand Down
2 changes: 1 addition & 1 deletion src/Model/ConfirmationTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Dieses Model bildet die Struktur von GET /confirmation-tags?confirmation_id={id} bzw. GET /confirmation-tags/{id} ab.
*
* Dokumentation:
* https://www.billomat.com/en/api/confirmations/tags/
* https://www.billomat.com/api/auftragsbestaetigungen/
*
* Generiert aus tools/codegen/definitions/confirmation-tags.php – nicht von Hand bearbeiten,
* sondern die Definition anpassen und `composer generate` ausführen.
Expand Down
2 changes: 1 addition & 1 deletion src/Model/ConfirmationTagCloudEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Jedes Schlagwort wird einmal mit seiner Häufigkeit geliefert.
*
* Dokumentation:
* https://www.billomat.com/en/api/confirmations/tags/
* https://www.billomat.com/api/auftragsbestaetigungen/
*
* Generiert aus tools/codegen/definitions/confirmation-tags.php – nicht von Hand bearbeiten,
* sondern die Definition anpassen und `composer generate` ausführen.
Expand Down
2 changes: 1 addition & 1 deletion src/Model/DeliveryNoteComment.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* enthält den ursprünglichen String aus der API.
*
* Dokumentation:
* https://www.billomat.com/en/api/delivery-notes/comments/
* https://www.billomat.com/api/lieferscheine/
*
* Generiert aus tools/codegen/definitions/delivery-note-comments.php – nicht von Hand bearbeiten,
* sondern die Definition anpassen und `composer generate` ausführen.
Expand Down
2 changes: 1 addition & 1 deletion src/Model/DeliveryNoteItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Dieses Model bildet die Struktur von GET /delivery-note-items?delivery_note_id={id} bzw. GET /delivery-note-items/{id} ab.
*
* Dokumentation:
* https://www.billomat.com/en/api/delivery-notes/items/
* https://www.billomat.com/api/lieferscheine/
*
* Generiert aus tools/codegen/definitions/delivery-note-items.php – nicht von Hand bearbeiten,
* sondern die Definition anpassen und `composer generate` ausführen.
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Enum/ConfirmationCommentActionKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* Typ eines Confirmation-Kommentars (actionkey).
*
* Doku: https://www.billomat.com/en/api/confirmations/comments/
* Doku: https://www.billomat.com/api/auftragsbestaetigungen/
*/
enum ConfirmationCommentActionKey: string
{
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Enum/DeliveryNoteCommentActionKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* Typ eines DeliveryNote-Kommentars (actionkey).
*
* Doku: https://www.billomat.com/en/api/delivery-notes/comments/
* Doku: https://www.billomat.com/api/lieferscheine/
*/
enum DeliveryNoteCommentActionKey: string
{
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Enum/OfferCommentActionKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Unbekannte Werte werden über `tryFrom()` als null behandelt; der Roh-String
* wird im Modell zusätzlich aufgehoben.
*
* Doku: https://www.billomat.com/en/api/estimates/comments/
* Doku: https://www.billomat.com/api/angebote/kommentare/
*/
enum OfferCommentActionKey: string
{
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Enum/RecurringEmailReceiverType.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* Typ eines E-Mail-Empfängers bei einer Abo-Rechnung.
*
* Doku: https://www.billomat.com/api/abo-rechnungen/email-empfaenger/
* Doku: https://www.billomat.com/api/abo-rechnungen/empfaenger/
*/
enum RecurringEmailReceiverType: string
{
Expand Down
2 changes: 1 addition & 1 deletion src/Model/InboxDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* Posteingangs-Dokument (Inbox Document).
*
* Doku: https://www.billomat.com/en/api/inbox-documents/
* Doku: https://www.billomat.com/api/eingangsrechnungen/inbox/
*/
final readonly class InboxDocument
{
Expand Down
6 changes: 3 additions & 3 deletions tests/Integration/Recurrings/RecurringsIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ public function canManageRecurringEmailReceiversInSandbox(): void
{
$billomat = $this->createBillomatClientOrSkip();

// E-Mail-Empfänger setzen ein Recurring voraus, das überhaupt Mails verschickt.
// Daher action=EMAIL mit minimalen E-Mail-Feldern. startDate weit in der Zukunft
// verhindert ungewollten Versand.
// Billomat nimmt Empfänger bei jeder action an (auch CREATE), wirksam werden sie aber nur
// beim Versand. Der Test nutzt daher action=EMAIL mit minimalen E-Mail-Feldern; startDate
// weit in der Zukunft verhindert ungewollten Versand.
$opts = $this->buildSafeDraft($billomat)
->withAction(RecurringAction::EMAIL)
->withEmailSubject('Integrationstest Abo-Versand')
Expand Down
2 changes: 1 addition & 1 deletion tools/codegen/definitions/confirmation-comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
label: 'einer Auftragsbestätigung',
parentField: 'confirmation_id',
specResource: null,
docUrl: 'https://www.billomat.com/en/api/confirmations/comments/',
docUrl: 'https://www.billomat.com/api/auftragsbestaetigungen/',
);
2 changes: 1 addition & 1 deletion tools/codegen/definitions/confirmation-items.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
label: 'Position einer Auftragsbestätigung',
parentField: 'confirmation_id',
specResource: null,
docUrl: 'https://www.billomat.com/en/api/confirmations/items/',
docUrl: 'https://www.billomat.com/api/auftragsbestaetigungen/',
);
2 changes: 1 addition & 1 deletion tools/codegen/definitions/confirmation-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
label: 'einer Auftragsbestätigung',
parentField: 'confirmation_id',
specResource: null,
docUrl: 'https://www.billomat.com/en/api/confirmations/tags/',
docUrl: 'https://www.billomat.com/api/auftragsbestaetigungen/',
);
2 changes: 1 addition & 1 deletion tools/codegen/definitions/delivery-note-comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
label: 'einem Lieferschein',
parentField: 'delivery_note_id',
specResource: null,
docUrl: 'https://www.billomat.com/en/api/delivery-notes/comments/',
docUrl: 'https://www.billomat.com/api/lieferscheine/',
);
2 changes: 1 addition & 1 deletion tools/codegen/definitions/delivery-note-items.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
label: 'Lieferscheinposition',
parentField: 'delivery_note_id',
specResource: null,
docUrl: 'https://www.billomat.com/en/api/delivery-notes/items/',
docUrl: 'https://www.billomat.com/api/lieferscheine/',
optionsOnly: ['unit_price', 'tax_name', 'tax_rate', 'reduction', 'total_gross', 'total_net', 'total_gross_unreduced', 'total_net_unreduced', 'created'],
);
Loading