Skip to content

refactor(client): configure Client with the Config DTO - #52

Merged
pekral merged 1 commit into
masterfrom
feat/client-config-dto
Nov 12, 2026
Merged

pekral merged 1 commit into
masterfrom
feat/client-config-dto

Conversation

@pekral

@pekral pekral commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Closes #50

TL;DR

Client se nově konfiguruje jedním objektem Config místo devíti samostatných parametrů. Stejně se už konfiguruje CompanyClient. Jde o BC break pro major verzi 2.0.0.

Navazuje na #48, proto míří do větve chore/pekral-tooling. Po mergi #48 se PR automaticky přesměruje na master.

Změny

  • Client::__construct(Config $config, ?HttpClient $httpClient = null). Stávající EcomailFlexibee\Config už je final readonly DTO se všemi hodnotami, takže nový typ není potřeba.
  • CompanyClient si odvozuje konfiguraci s evidencí c přes novou metodu Config::withEvidence(), která vrací upravenou kopii.
  • README ukazuje nové použití a návod na přechod z 1.x.

Přechod z 1.x

// 1.x
$client = new Client($url, $company, $user, $password, $evidence, false, null);
// 2.0
$client = new Client(new Config($url, $company, $user, $password, $evidence, false, null));

Merge danger

  • Dveře: two-way.
  • BC break: každé new Client(...) u uživatelů balíčku je potřeba upravit podle návodu výše. Chování klienta se nemění.

Testování

  • composer check prochází. Unit testy (ClientOfflineTest, CompanyClientTest, nový ConfigTest) pokrývají všech 12 změněných řádků.
  • Integrační ClientTest je přepsaný na nové API (běží proti demo serveru, v CI se nespouští).

@pekral pekral added this to the 2.0.0 milestone Nov 12, 2026
@pekral
pekral marked this pull request as ready for review November 12, 2026 14:15
@pekral

pekral commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator Author

Code Review

Status: clean
Counts: Critical 0 · Moderate 0 · Minor 0 · Refactoring 0
Last updated: 2026-11-12T14:31:40Z (head 51dd384, rebased on master after #48 and #51; own change unchanged)
Issue tracker summary: no linked issue summary posted — #50 is the source issue (technical refactor, no separate non-technical summary)


Summary: 0 Critical · 0 Moderate · 0 Minor · 0 Refactoring · assignment conformance: conformant (#50: Client and CompanyClient take Config, README shows migration, BC break targeted at 2.0.0) · reviewer comments: none

@pekral
pekral deleted the branch chore/pekral-tooling November 12, 2026 14:25
@pekral pekral closed this Nov 12, 2026
@pekral pekral reopened this Nov 12, 2026
@pekral
pekral changed the base branch from chore/pekral-tooling to master November 12, 2026 14:27
Client::__construct() now takes the existing final readonly Config DTO
(and an optional HttpClient) instead of nine scalar parameters, matching
CompanyClient, which already received a Config. CompanyClient derives
its configuration through the new Config::withEvidence() copy method.

BREAKING CHANGE: `new Client($url, $company, $user, $password, $evidence,
$verifySSLCertificate, $authSessionId, $debugMode)` becomes
`new Client(new Config(...the same values...))`. The README shows the
migration.

Closes #50
@pekral
pekral force-pushed the feat/client-config-dto branch from 9a6c3fc to 51dd384 Compare November 12, 2026 14:30
@pekral
pekral merged commit f3e9c8a into master Nov 12, 2026
4 checks passed
@pekral
pekral deleted the feat/client-config-dto branch November 12, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pass the Client configuration as the Config DTO

1 participant