You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: Report mode: collect violations instead of throwing #94
'on_violation' => 'report': no exception; each violation is recorded once (file, line, function, parameter or return, expected type, given value) and written to a JSON file at shutdown.
Motivation / Use Case
Adopting TypePHP on an existing codebase. The first run surfaces many wrong docblocks, and today each one throws. When a violation sits on the bootstrap path (code that runs before any test), it stops the whole test suite, so we found them one at a time: four CI runs for four violations. Violations inside a test also hide every later one in the same call path.
With a report mode, the first run gives the full list. Once it is cleaned up, we switch to throw and keep it as a gate.
@fdaviddpt Thank you this is a great idea, This is also a good feature for the next minor release so hold your buckle.. I won't be doing this in patch release but this feature will and the other request will be prioritized in the next v0.11.0 release..
Thanks a lot, looking forward to v0.11.0. Two details from our setup that may be worth designing in from the start:
Parallel runs: with ParaTest, each worker would write the same report_file. One file per worker (e.g. suffixed with TEST_TOKEN), or a merge at the end, would avoid lost or interleaved entries.
Exit status: an option to still fail the process at shutdown when the report is not empty (e.g. 'fail_on_report' => true) would let CI keep a gate without going back to throw.
@fdaviddpt hi, I have fixed all of the bugs and also implemented all of the requested feature, I'm just adding more features and after this will be releasing the new minor 0.11 release.. In the meantime you can checkout #100 PR and use the branch in your composer dependency to see if everything is set..
Hello I had now release the minor version v0.11.0 and resolve all your submitted issues.. If you have more problem don't hesitate to submit more issues..
Activity
rcalicdan commentedon Oct 3, 2026
@fdaviddpt Thank you this is a great idea, This is also a good feature for the next minor release so hold your buckle.. I won't be doing this in patch release but this feature will and the other request will be prioritized in the next v0.11.0 release..
fdaviddpt commentedon Oct 3, 2026
Thanks a lot, looking forward to v0.11.0. Two details from our setup that may be worth designing in from the start:
report_file. One file per worker (e.g. suffixed withTEST_TOKEN), or a merge at the end, would avoid lost or interleaved entries.'fail_on_report' => true) would let CI keep a gate without going back tothrow.rcalicdan commentedon Oct 3, 2026
Thank you, for the exit status addition.. This will come in handy..
rcalicdan commentedon Oct 4, 2026
@fdaviddpt hi, I have fixed all of the bugs and also implemented all of the requested feature, I'm just adding more features and after this will be releasing the new minor 0.11 release.. In the meantime you can checkout #100 PR and use the branch in your composer dependency to see if everything is set..
rcalicdan commentedon Oct 4, 2026
Hello I had now release the minor version v0.11.0 and resolve all your submitted issues.. If you have more problem don't hesitate to submit more issues..