Release/3.0.0 - #162
Conversation
…tories, enums, PHP 8.1+ - ZammadClient with typed factory methods replaces Client (arrays, magic strings) - Repository pattern + typed DTOs replaces Resource + ResourceType enums - Typed exceptions (NotFoundException, etc.) replaces hasError()/getError() - PHP >= 8.1 (was PHP >= 7.2) - src/Client.php, src/HTTPClient.php, src/HTTPClientInterface.php - src/Resource/ — all 10 resource classes - src/ResourceType.php, src/Exception/ - test/ZammadAPIClient/ — old test suite - examples/ticket.php, examples/user.php, examples/v2-usage.php - ZammadClient, RequestHandler, RetryAfterMiddleware, AbstractRepository, PaginatedList, Resource, DtoHydrator, Cast, ConnectionConfig, RepositoryRegistry, ResponseParser, HttpPageFetcher, traits - RepositoryInterface, DTOInterface, DeletableInterface, PatchableInterface, RequestHandlerInterface, ClientInterface, PageFetcherInterface - Tickets (CRUD + delete + getTicketArticles), TicketDTO, TicketUpdateDTO - Users (CRUD + delete + CSV import), UserDTO - Organizations (CRUD + delete + CSV import), OrganizationDTO - Groups (CRUD + delete), GroupDTO - TicketArticles (getForTicket, getAttachmentContent), TicketArticleDTO, TicketArticleType enum (Note, Email, Phone, Sms, Web) - TicketStates (read-only), TicketStateDTO - TicketPriorities (read-only), TicketPriorityDTO - Tags (add, remove, tagSearch), TagDTO - TextModules (CRUD + delete + CSV import), TextModuleDTO - Links (add, remove, list), LinkDTO - AuthenticationException (401), ForbiddenException (403), NotFoundException (404), ValidationException (422, with $errors array), RateLimitException (429, auto-retried), ServerErrorException (5xx), NetworkException - LaravelServiceProvider, SymfonyBundle - docs/migration-v3.md, docs/migration-v3-examples.md (15 side-by-side examples) - docs/v2-reference.md, docs/alternative-clients.md - examples/cookbook.php (9 runnable v3 recipes) - README.md with DTO field tables, update decision guide, error mapping, paradigm guide, delete() availability table
…rsonationHandler, slim client) Split the monolithic ZammadClient into focused classes: - ClientFactory → GuzzleClientFactory implements ClientFactoryInterface Guzzle wiring lives exclusively in GuzzleClientFactory::buildClient() Non-Guzzle via new ZammadClient(new RequestHandler(...)) - ImpersonationHandler — stateless decorator implementing RequestHandlerInterface. Injects From header on every request including getRaw(). No shared mutable state. - ZammadClient — slimmed from ~210 to ~79 lines. Only repo() and getHandler(). Repository access via typed, explicit, IDE-friendly methods (ticket(), user(), group(), etc.) implemented directly on the class. Removals and cleanups: - __call, aliasMap, resolveAlias — replaced by explicit typed methods - RequestHandler:: — shared mutable state removed - RequestHandlerInterface::setOnBehalfOfUser/getOnBehalfOfUser — removed - RequestHandlerInterface::getRaw() extended with $headers parameter for ImpersonationHandler compatibility - onBehalfOf() / performOnBehalfOf() — not a Client concern; use new ZammadClient(new ImpersonationHandler($handler, $userId)) - getListKey() default $this->resourcePath; 10 identical impls removed Namespace structure: Core/Contracts/ — ClientInterface, ClientFactoryInterface Core/Repository/ — AbstractRepository, RepositoryRegistry, PaginatedList, Resource, ResponseParser, DtoHydrator Core/Transport/ — RequestHandler, RetryAfterMiddleware, ImpersonationHandler, HttpPageFetcher Core/Traits/ — RepositoryAccessors (opt-in for custom ClientInterface impls), HasTimestamps, HydratesFromArray, SerializesToArray Factory/ — GuzzleClientFactory Bug fixes: - HttpPageFetcher::extractIndexResults() now reads total_count from API response instead of hard-coding null
- Delete monolithic examples/cookbook.php - 00-plain.php: Guzzle setup, copy-paste-ready - 00-laravel.php: Laravel service container reference - 00-symfony.php: Symfony bundle reference - 00-slim.php: Non-Guzzle setup (Symfony HttpClient + Nyholm) - 01-quick-start.php: client setup + find() - 02-crud.php: create, read, delete, error handling - 03-listing.php: all() streaming, list() pagination, totalCount() - 04-updates.php: patch(), TicketUpdateDTO, Resource wrapper - 05-impersonation.php: ImpersonationHandler decoration - 06-search.php: search(), searchList(), pagination - CookbookIntegrationTest: executes recipes 01-06 via exec() - README.md: recipe overview and run instructions
…oryAccessors trait, improve test coverage
Corrected the link to the cookbook example in the README.
|
Important Review skippedToo many files! This PR contains 173 files, which is 73 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (4)
📒 Files selected for processing (173)
You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Restored release PR (previous #156 was merged prematurely and master was reset). Keep open until v3 is ready.