DoctrineExtensions icon indicating copy to clipboard operation
DoctrineExtensions copied to clipboard

Add support for blameable on remove

Open oojacoboo opened this issue 10 months ago • 5 comments

This PR adds support for blameable on remove/deletion of an entity. This can be very useful, when used in conjunction with soft-delete. It obviously is useless without soft-delete.

Docs have been updated a tests added.

oojacoboo avatar Mar 06 '25 15:03 oojacoboo

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 78.48%. Comparing base (8264aad) to head (c016b37). :warning: Report is 21 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2929      +/-   ##
==========================================
- Coverage   78.51%   78.48%   -0.03%     
==========================================
  Files         168      168              
  Lines        8782     8826      +44     
==========================================
+ Hits         6895     6927      +32     
- Misses       1887     1899      +12     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Mar 17 '25 18:03 codecov[bot]

Couple things here:

  • I don't understand why PHP 7.x is being supported still. Why can't people that need 7.4 support use an older version of this lib? How long do you guys intend on trying to continue to support it? It makes it difficult trying to properly type this lib when supporting such a old version. PHP isn't even supporting PHP 8.0 anymore. Annotations (only attributes supported) should be entirely dropped from this lib IMO, for all future versions.
  • What's going on with the PHPStan errors? I didn't make changes to these files.

oojacoboo avatar Mar 17 '25 18:03 oojacoboo

What's going on with the PHPStan errors? I didn't make changes to these files.

You are removing @phpstan-template annotations, so errors like this are expected:

Error: Generic type Gedmo\Mapping\MappedEventSubscriber<array, Gedmo\Mapping\Event\AdapterInterface> in PHPDoc tag @extends specifies 2 template types, but class Gedmo\Mapping\MappedEventSubscriber supports only 1: TConfig

phansys avatar Mar 24 '25 19:03 phansys

@phansys I've resolved the PHPStan issues. I'm a bit confused with what's going on with PHPStan on this lib, though. There is a phpstan-baseline.neon file that's over 1200 lines of ignores. Also, does PHPStan not read the default phpdoc annotations now (@param, @return, etc)?

Also, IMO, it'd be a good idea to drop support for some of these unsupported versions of PHP. It's holding back the lib and making updates and codestyle much more difficult.

Please let me know if anything else is needed here - should be ready.

oojacoboo avatar Mar 26 '25 04:03 oojacoboo

@mbabker @phansys Can we get this merged?

oojacoboo avatar Jun 23 '25 16:06 oojacoboo