Download the PHP package dwenzel/reporter-api without Composer
On this page you can find all versions of the php package dwenzel/reporter-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package reporter-api
Reporter API
A modern PHP library providing a reporting API for web applications. Designed as PSR-7/PSR-15 middleware that collects and reports application status information including installed packages, repositories, and application metadata.
Features
- ๐ Modern PHP 8.1+ with native enums, constructor property promotion, and strict types
- ๐ Application Status Reporting with package information and metadata
- ๐ PSR-7/PSR-15 Compatible middleware for easy integration
- ๐ฏ Null Object Pattern for robust error handling
- ๐ OpenAPI 3.0 Specification with complete API documentation
- ๐งช 100% Test Coverage with PHPUnit 11
- ๐ JWT Authentication support
Requirements
- PHP 8.1+ (required for native enum support)
- Composer for dependency management
- PHPUnit 10.5+ or 11.0+ for testing (dev dependency)
Installation
Install via Composer:
Quick Start
Basic Usage as PSR-15 Middleware
Using the Report Endpoint Directly
Working with Application Status
API Endpoints
GET /api/reporter/v1/application/report
Returns a comprehensive JSON report containing:
- Application metadata (name, ID, status)
- Installed package information with versions
- Repository details
- Status indicators
Example Response:
Architecture
Core Components
Api: Main PSR-15 middleware class with endpoint routingEndpoint\Report: Primary reporting endpoint implementationSchema\*: Data models representing API response structureHttp\*: PSR-7 HTTP message implementations
Design Patterns
- Endpoint Routing: Path-based routing with lazy loading
- Schema Serialization: JSON serialization via traits
- Null Object Pattern: Robust error handling
- Dependency Integration: Leverages
cpsit/auditorfor package discovery
Testing
Run the test suite:
Test Coverage
The library maintains 100% test coverage with comprehensive unit tests for all components.
Configuration
Custom Endpoint Registration
JWT Authentication
The API supports JWT token authentication as defined in the OpenAPI specification. Include the api_key header in your requests:
Development
Project Structure
Modern PHP Features
This library showcases modern PHP development practices:
- Native Enums (PHP 8.1):
ApplicationStatusenum with string backing - Constructor Property Promotion (PHP 8.0): Clean, concise constructors
- Typed Properties (PHP 7.4): All properties are strictly typed
- Strict Types: Enabled across the entire codebase
- Union Types: Used where appropriate for flexibility
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes with proper tests
- Ensure all tests pass (
composer test) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Code Standards
- PHP 8.1+ with strict types
- PSR-4 autoloading
- PSR-7/PSR-15 compliance
- 100% test coverage
- Modern PHP conventions
API Documentation
Complete API documentation is available in the OpenAPI 3.0 specification:
- OpenAPI Spec:
reporterApi.yaml - Interactive Documentation: Use tools like Swagger UI to explore the API
License
This project is licensed under the GPL-2.0+ License - see the LICENSE file for details.
Authors
- Dirk Wenzel - Initial work and maintenance
Dependencies
Runtime Dependencies
- PHP 8.1+: Core language requirement
- cpsit/auditor: Package information gathering
- web-token/jwt-framework: JWT token handling
Development Dependencies
- PHPUnit 10.5+/11.0+: Testing framework
- roave/security-advisories: Security vulnerability monitoring
Changelog
See ChangeLog for a detailed history of changes and improvements.
Need help? Open an issue on GitHub or check the OpenAPI specification for detailed API documentation.
All versions of reporter-api with dependencies
cpsit/auditor Version *
web-token/jwt-framework Version ^2.0 || ^3.1 || ^4.1