Skip to content

Commit 4778877

Browse files
pscheitclaude
andcommitted
Add dev tooling: composer test, composer cs-fix, phpunit.xml.dist, CLAUDE.md
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 3cff6dd commit 4778877

3 files changed

Lines changed: 44 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Private Packagist API Client
2+
3+
PHP API client for Private Packagist.
4+
5+
## Commands
6+
7+
- `composer test` — Run tests
8+
- `composer cs-fix` — Fix code style (src + tests)
9+
10+
## Architecture
11+
12+
- `src/Api/AbstractApi.php` — Base class for all API endpoints. Provides `get()` for single resources and `getCollection()` for list endpoints with auto-pagination.
13+
- `src/Api/*.php` — API endpoint classes (Packages, Teams, Customers, etc.)
14+
- `src/Api/*/` — Nested API endpoints (e.g. `Customers/VendorBundles`, `Packages/Artifacts`)
15+
- `src/Client.php` — Entry point, provides access to all API classes
16+
17+
## Notes
18+
19+
- Supports PHP 7.2+ — avoid modern syntax not available in 7.2
20+
21+
## Conventions
22+
23+
- List endpoints use `getCollection()` (handles pagination and default limit)
24+
- Single-resource endpoints use `get()`

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
"psr-4": { "PrivatePackagist\\ApiClient\\": "tests/"}
3636
},
3737
"scripts": {
38+
"cs-fix": "php-cs-fixer fix",
39+
"test": "phpunit",
3840
"toc": "./gh-md-toc --insert README.md"
3941
},
4042
"config": {

phpunit.xml.dist

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
colors="true"
6+
>
7+
<testsuites>
8+
<testsuite name="default">
9+
<directory>tests</directory>
10+
</testsuite>
11+
</testsuites>
12+
13+
<coverage>
14+
<include>
15+
<directory suffix=".php">src</directory>
16+
</include>
17+
</coverage>
18+
</phpunit>

0 commit comments

Comments
 (0)