localgovdrupal / localgov_alert_banner

Alert banner module for LocalGovDrupal
GNU General Public License v2.0
4 stars 8 forks source link

Fix code depreactions for phpstan 1.x (required for PHP 8.1) #198

Closed stephen-cox closed 2 years ago

stephen-cox commented 2 years ago

We need to upgrade phpstan to 1.x for PHP 8.1. This highlights the following issues:

 ------ ----------------------------------------------------------------------------------------------------------------------------------------- 
  Line   modules/contrib/localgov_alert_banner/src/Form/AlertBannerEntityDeleteForm.php                                                           
 ------ ----------------------------------------------------------------------------------------------------------------------------------------- 
  12     Class Drupal\localgov_alert_banner\Form\AlertBannerEntityDeleteForm extends @internal class Drupal\Core\Entity\ContentEntityDeleteForm.  
         💡 Extend \Drupal\Core\Entity\ContentEntityConfirmFormBase. See https://www.drupal.org/node/2491057                                      
 ------ -----------------------------------------------------------------------------------------------------------------------------------------
andybroomfield commented 2 years ago

Discussion on https://www.drupal.org/node/2491057 is unclear whether we should proceed, however I've opened up a new PR in an attempt to address this since the core class does exist.

andybroomfield commented 2 years ago

Trying to understand the issue, is it that we should remove and just use the generic ContentEntityDeleteForm instead of extending it? As we don't override anything. Looking at localgov_geo for how it handles entity deletion, it does not include its own entity delete form. I think that is the better method to use.