From 6513e717ceac8aaebbb8359efeacf585dd996112 Mon Sep 17 00:00:00 2001
From: Philipp Scheit
Date: Fri, 30 Jan 2026 07:25:20 +0100
Subject: [PATCH 1/2] Add dev tooling: composer test, composer cs-fix,
phpunit.xml.dist, CLAUDE.md
Co-Authored-By: Claude Opus 4.5
---
.github/workflows/php.yml | 4 ++--
CLAUDE.md | 25 +++++++++++++++++++++++++
composer.json | 3 +++
phpunit.xml.dist | 18 ++++++++++++++++++
4 files changed, 48 insertions(+), 2 deletions(-)
create mode 100644 CLAUDE.md
create mode 100644 phpunit.xml.dist
diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml
index b13df1d..b030c1d 100644
--- a/.github/workflows/php.yml
+++ b/.github/workflows/php.yml
@@ -40,7 +40,7 @@ jobs:
run: composer install --prefer-dist --no-progress
- name: PHPUnit
- run: ./vendor/bin/phpunit tests
+ run: ./vendor/bin/phpunit
- name: PHP-CS-Fixer
run: ./vendor/bin/php-cs-fixer fix --dry-run --diff
@@ -48,4 +48,4 @@ jobs:
PHP_CS_FIXER_IGNORE_ENV: 1
- name: PHPStan
- run: ./vendor/bin/phpstan analyze src --no-progress
+ run: ./vendor/bin/phpstan analyze --no-progress
diff --git a/CLAUDE.md b/CLAUDE.md
new file mode 100644
index 0000000..df41e2d
--- /dev/null
+++ b/CLAUDE.md
@@ -0,0 +1,25 @@
+# Private Packagist API Client
+
+PHP API client for Private Packagist.
+
+## Commands
+
+- `composer test` — Run tests
+- `composer cs-fix` — Fix code style (src + tests)
+- `composer analyze` — Run PHPStan static analysis
+
+## Architecture
+
+- `src/Api/AbstractApi.php` — Base class for all API endpoints. Provides `get()` for single resources and `getCollection()` for list endpoints with auto-pagination.
+- `src/Api/*.php` — API endpoint classes (Packages, Teams, Customers, etc.)
+- `src/Api/*/` — Nested API endpoints (e.g. `Customers/VendorBundles`, `Packages/Artifacts`)
+- `src/Client.php` — Entry point, provides access to all API classes
+
+## Notes
+
+- Supports PHP 7.2+ — avoid modern syntax not available in 7.2
+
+## Conventions
+
+- List endpoints use `getCollection()` (handles pagination and default limit)
+- Single-resource endpoints use `get()`
\ No newline at end of file
diff --git a/composer.json b/composer.json
index 69253f1..c2ee976 100644
--- a/composer.json
+++ b/composer.json
@@ -35,6 +35,9 @@
"psr-4": { "PrivatePackagist\\ApiClient\\": "tests/"}
},
"scripts": {
+ "analyze": "phpstan analyze --no-progress",
+ "cs-fix": "php-cs-fixer fix",
+ "test": "phpunit",
"toc": "./gh-md-toc --insert README.md"
},
"config": {
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
new file mode 100644
index 0000000..f86d23c
--- /dev/null
+++ b/phpunit.xml.dist
@@ -0,0 +1,18 @@
+
+
+
+
+ tests
+
+
+
+
+
+ src
+
+
+
From e9be59ff3f8673305ba31317589674291fa580bd Mon Sep 17 00:00:00 2001
From: Philipp Scheit
Date: Fri, 30 Jan 2026 07:52:45 +0100
Subject: [PATCH 2/2] add useful ignores
---
.github/workflows/php.yml | 2 +-
.gitignore | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml
index b030c1d..ad0715b 100644
--- a/.github/workflows/php.yml
+++ b/.github/workflows/php.yml
@@ -24,7 +24,7 @@ jobs:
- "8.4"
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
diff --git a/.gitignore b/.gitignore
index 6846b7c..93604a2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,5 @@ vendor
composer.lock
README.md.*
+/.idea/
+/.serena/