localgovdrupal / localgov_paragraphs

Configuration and dependencies for paragraphs components for the LocaGov Drupal distribution.
GNU General Public License v2.0
0 stars 5 forks source link

Deprecation error in CI #163

Closed rupertj closed 3 months ago

rupertj commented 10 months ago

See here: https://github.com/localgovdrupal/localgov_paragraphs/actions/runs/7426621431/job/20210755941

Error: Call to deprecated function format_size():
in drupal:10.2.0 and is removed from drupal:11.0.0. Use
  \Drupal\Core\StringTranslation\ByteSizeMarkup::create($size, $langcode)
  instead.
 ------ -------------------------------------------------------------------------- 
  Line   modules/localgov_subsites_paragraphs/localgov_subsites_paragraphs.module  
 ------ -------------------------------------------------------------------------- 
  211    Call to deprecated function format_size():                                
         in drupal:10.2.0 and is removed from drupal:11.0.0. Use                   
           \Drupal\Core\StringTranslation\ByteSizeMarkup::create($size,            
         $langcode)                                                                
           instead.                                                                
 ------ -------------------------------------------------------------------------- 
rupertj commented 10 months ago

Actually, I think I got a little ahead of myself here. It looks like ByteSizeMarkup::create() only got introduced in 10.2, so we don't want to merge this until we're happy to drop support for 10.1.

andybroomfield commented 9 months ago

Suggest we add // @phpstan-ignore-next-line. for now until we can bump support to 10.2+

rupertj commented 9 months ago

Good plan. I'm also wondering if we can make a failure on the deprecated code check into a warning instead of an error. I know how to do this on GitLab CI, but not GitHub actions.

millnut commented 9 months ago

I agree with @andybroomfield we should use // @phpstan-ignore-next-line to ignore for now. I would be in favour of this for the full comment which will highlight in various IDE tools that we need to fix it in future;

// FIXME: Replace with ByteSizeMarkup, when Drupal 10.1 is end of life.
// @phpstan-ignore-next-line.
stephen-cox commented 9 months ago

I've created a PR to ignore this using @millnut suggestion above #166