mediacurrent / theme_generator_8

Yeoman generator for Drupal Themes - lets you quickly set up a Drupal 8 theme with sensible defaults and best practices.
MIT License
100 stars 25 forks source link

BasicTwigExtensions.php doesn't pass deprecations tests nor coding standards #129

Open joestewart opened 2 years ago

joestewart commented 2 years ago

Using drupal-check:

1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ ------------------------------------------------------------------ 
  Line   BasicTwigExtensions.php                                           
 ------ ------------------------------------------------------------------ 
         Reflection error: Provided node "Twig_ExtensionInterface" is not  
         interface, but "class"                                            
  8      Reflection error: Provided node "Twig_ExtensionInterface" is not  
         interface, but "class"                                            
  8      Reflection error: Provided node "Twig_ExtensionInterface" is not  
         interface, but "class"                                            
  8      Reflection error: Provided node "Twig_ExtensionInterface" is not  
         interface, but "class"                                            
 ------ ------------------------------------------------------------------ 

 [ERROR] Found 4 errors

Using phpcs:

--------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AND 2 WARNINGS AFFECTING 6 LINES
--------------------------------------------------------------------------------------------------------------------
  3 | ERROR   | Missing short description in doc comment
  7 | ERROR   | Missing short description in doc comment
  9 | WARNING | Line exceeds 80 characters; contains 85 characters
 10 | ERROR   | Missing parameter type
 13 | ERROR   | Invalid function name, expected twig_extensions but found twigExtensions
 13 | ERROR   | Expected type hint "Twig_Environment"; found "\Twig_Environment" for $env
 15 | WARNING | Line exceeds 80 characters; contains 81 characters
--------------------------------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------------
 106 | ERROR | The text '@deprecated since 1.23 (to be removed in 2.0), implement Twig_Extension_GlobalsInterface instead' does not
     |       | match the standard format: @deprecated in %deprecation-version% and is removed from %removal-version%. %extra-info%.
 106 | ERROR | Each @deprecated tag must have a @see tag immediately following it
 118 | ERROR | The text '@deprecated since 1.26 (to be removed in 2.0), not used anymore internally' does not match the standard
     |       | format: @deprecated in %deprecation-version% and is removed from %removal-version%. %extra-info%.
 118 | ERROR | Each @deprecated tag must have a @see tag immediately following it
-------------------------------------------------------------------------------------------------------------------------------------

Time: 387ms; Memory: 10MB
richlawson commented 2 years ago

Also noting here that I made the changes for the deprecation, I did not see the phpcs violations locally with the standard Drupal profile.

PR: https://github.com/mediacurrent/theme_generator_8/pull/130