- Issue created by @nicxvan
- π¦πΊAustralia mstrelan
Looks fine to me, only question is if we've given up on single hook classes with __invoke methods, like
\Drupal\file\Hook\CronHook
? Otherwise we could do this for cron and help here, even theme if we don't intend to use it for anything else. - πΊπΈUnited States nicxvan
I'm not really a fan of that approach to be honest.
- πΊπΈUnited States smustgrave
Question from my phpstorm. Since all the parameters are being marked readonly phpstorm wants to mark the class readonly too. Is that valid?
- πΊπΈUnited States nicxvan
I have no idea the implications of that, I would need to read up.
- π¦πΊAustralia mstrelan
Yeah I've considered the same. If the class is readonly then all properties are readonly, including those of child classes. I believe that would be fine, but given there is pushback for having final classes then I guess we shouldn't restrict what they can do either?
- πΊπΈUnited States smustgrave
Was more curious, it was a recommendation IDE was making not sure where it pulls it from
- π¦πΊAustralia mstrelan
If the php language level in phpstorm is 8.2 or above (when readonly classes were introduced) and all properties on the class are marked readonly, then it will suggest that the class can be readonly.