How assoconnect/linxo-client works
Main Components
a) Authentication Layer:
• AuthClient component for OAuth2 authentication
• Token management system
• Mock authentication system for testing
b) API Layer:
• Main ApiClient for API interactions
• DTO (Data Transfer Objects) system
• Iterator system for handling paginated responses
• Mock system for testing
c) External Systems:
• Linxo API (external)
• Client Application (consumer of this library)
Flow Representations
• Authentication flow:
• Client App → AuthClient → Linxo OAuth2 → Token
• Token refresh flow
• API interaction flow:
• Client App → ApiClient → DTOs → Linxo API
• Testing flow:
• Test Suite → MockAuthClient → Mock Responses
Component Relationships
• AuthClient creating ApiClient instances
• ApiClient using DTOs
• Mock system's integration points
• Iterator's relationship with API responses
Technical Details
• Composer dependency management
• PHPUnit test integration
• Guzzle middleware system
• Internationalization support (translations)