- Issue created by @begamen
- Status changed to RTBC
8 months ago 2:41pm 20 August 2024 - π©πͺGermany gngn
As mentioned #4 worked for me.
But taking a deeper look: the abstract constructor from CMRFManagerBase
abstract class CMRFManagerBase { protected $core; public function __construct($core, $translation) { $this->core = $core; $this->stringTranslation = $translation; }
Since $stringTranslation is not declared this is a creation of dynamic property.
This is changed by #4 by dropping parameter $translation and the assignment ().Getting rid of $stringTranslation seems to be no problem since it is never used.
But ... extending classes could explicitly call the base constructor with $translation - and e.g. CMRFSubmissionsManager does this:
class CMRFSubmissionsManager extends CMRFManagerBase { protected $queueFactory; public function __construct($core, $translation, $queue) { parent::__construct($core, $translation); $this->queueFactory = $queue; }
I am not 100% sure but I think this call will fail.
So I think it would be better to
- Either also correct the call in CMRFSubmissionsManager to not also use use $translation.
- Or just declare the property $stringTranslation in CMRFManagerBase
Any thoughts?
- π©πͺGermany gngn
Following my thoughts in #8 I created a new patch which does not drop $stringTranslation but instead declares it.
This way extending classes or other external usages can still explicitly call the constructor with parameter $translation (like CMRFSubmissionsManager does).
Setting back to Needs Review.