Summary
src/Testing/QuantumFake.php is confirmed to be 754 lines, implementing in one class: call recording (circuits, batches, dispatches, entropy calls), four independent stubbing mechanisms (measurement-count stubs, entropy-byte stubs, cost-estimate stubs, task-status stubs for checkTask()), and 12 public assert* methods (assertCircuitRan, assertEntropyGenerated, assertCircuitNotRan, assertEntropyNotGenerated, assertCircuitRanTimes, assertEntropyGeneratedTimes, assertCircuitDispatched, assertCircuitNotDispatched, assertCircuitDispatchedTimes, assertBatchRan, assertBatchNotRan, assertBatchRanTimes) plus one private assertion helper.
Where
src/Testing/QuantumFake.php:1-754 (whole file)
src/Testing/QuantumFake.php:410-580 (the 12 public assert* methods)
src/Testing/Concerns/ValidatesCounts.php — an existing trait extraction shows the pattern is already partly recognized, but the bulk of the class remains monolithic
Refactor proposal
Split along the four already-distinct responsibilities: a Recorder (or similar) holding the call log, separate stub-strategy objects for counts/entropy/cost/task-status (each already conceptually independent per the constructor-stub docblock's own enumeration of four stubbing forms), and the assertion methods as a trait mixed into the main QuantumFake facade class so Quantum::fake()'s returned object keeps the same public API. This is a pure internal reorganization — no behavior change — aimed at making each concern independently testable and reviewable.
Severity: low
Summary
src/Testing/QuantumFake.phpis confirmed to be 754 lines, implementing in one class: call recording (circuits, batches, dispatches, entropy calls), four independent stubbing mechanisms (measurement-count stubs, entropy-byte stubs, cost-estimate stubs, task-status stubs forcheckTask()), and 12 publicassert*methods (assertCircuitRan,assertEntropyGenerated,assertCircuitNotRan,assertEntropyNotGenerated,assertCircuitRanTimes,assertEntropyGeneratedTimes,assertCircuitDispatched,assertCircuitNotDispatched,assertCircuitDispatchedTimes,assertBatchRan,assertBatchNotRan,assertBatchRanTimes) plus one private assertion helper.Where
src/Testing/QuantumFake.php:1-754(whole file)src/Testing/QuantumFake.php:410-580(the 12 publicassert*methods)src/Testing/Concerns/ValidatesCounts.php— an existing trait extraction shows the pattern is already partly recognized, but the bulk of the class remains monolithicRefactor proposal
Split along the four already-distinct responsibilities: a
Recorder(or similar) holding the call log, separate stub-strategy objects for counts/entropy/cost/task-status (each already conceptually independent per the constructor-stub docblock's own enumeration of four stubbing forms), and the assertion methods as a trait mixed into the mainQuantumFakefacade class soQuantum::fake()'s returned object keeps the same public API. This is a pure internal reorganization — no behavior change — aimed at making each concern independently testable and reviewable.Severity: low