Address PHPSTAN issues

Created on 10 December 2024, 4 months ago

Problem/Motivation

This is a good first time issue for new users

The pipeline lists a number of phpstan errors that need to be address

Steps to reproduce

N/A

Proposed resolution

Address all

Remaining tasks

Do it
Implement
Pipeline works

User interface changes

N/A

API changes

N/A

Data model changes

N/A

๐Ÿ“Œ Task
Status

Active

Version

4.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @smustgrave
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    FYI I tagged for novice for new users to try first

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    So please reserve for them. Ticket isnโ€™t 24hours old yet

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rahul_ Alirajpur

    I can take this, and start work on it.

  • ๐Ÿ‡ธ๐Ÿ‡ฌSingapore anish.a Singapore

    anish.a โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡ธ๐Ÿ‡ฌSingapore anish.a Singapore

    FYI, these are the errors

     30/30 [โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“] 100%
    
     ------ ------------------------------------------------------------------------------ 
      Line   quicktabs_accordion/src/Plugin/TabRenderer/AccordionTabs.php                  
     ------ ------------------------------------------------------------------------------ 
      54     \Drupal calls should be avoided in classes, use dependency injection instead  
     ------ ------------------------------------------------------------------------------ 
    
     ------ ------------------------------------------------------------------------------ 
      Line   quicktabs_jqueryui/src/Plugin/TabRenderer/UiTabs.php                          
     ------ ------------------------------------------------------------------------------ 
      27     \Drupal calls should be avoided in classes, use dependency injection instead  
     ------ ------------------------------------------------------------------------------ 
    
     ------ ----------------------------------------------------------------------------------- 
      Line   src/Controller/QuickTabsController.php                                             
     ------ ----------------------------------------------------------------------------------- 
      48     Unsafe usage of new static().                                                      
             ๐Ÿ’ก See: https://phpstan.org/blog/solving-phpstan-error-unsafe-usage-of-new-static  
     ------ ----------------------------------------------------------------------------------- 
    
     ------ ----------------------------------------------------------------------------------- 
      Line   src/Form/QuickTabsInstanceEditForm.php                                             
     ------ ----------------------------------------------------------------------------------- 
      49     Unsafe usage of new static().                                                      
             ๐Ÿ’ก See: https://phpstan.org/blog/solving-phpstan-error-unsafe-usage-of-new-static  
     ------ ----------------------------------------------------------------------------------- 
    
     ------ ----------------------------------------------------------------------------------- 
      Line   src/Plugin/Block/QuickTabsBlock.php                                                
     ------ ----------------------------------------------------------------------------------- 
      50     Unsafe usage of new static().                                                      
             ๐Ÿ’ก See: https://phpstan.org/blog/solving-phpstan-error-unsafe-usage-of-new-static  
     ------ ----------------------------------------------------------------------------------- 
    
     ------ ------------------------------------------------------------------------------ 
      Line   src/Plugin/Derivative/QuickTabsBlock.php                                      
     ------ ------------------------------------------------------------------------------ 
      18     \Drupal calls should be avoided in classes, use dependency injection instead  
     ------ ------------------------------------------------------------------------------ 
    
     ------ ------------------------------------------------------------------------------ 
      Line   src/Plugin/TabRenderer/QuickTabs.php                                          
     ------ ------------------------------------------------------------------------------ 
      74     \Drupal calls should be avoided in classes, use dependency injection instead  
     ------ ------------------------------------------------------------------------------ 
    
     ------ ------------------------------------------------------------------------------ 
      Line   src/Plugin/TabType/BlockContent.php                                           
     ------ ------------------------------------------------------------------------------ 
      67     \Drupal calls should be avoided in classes, use dependency injection instead  
      69     \Drupal calls should be avoided in classes, use dependency injection instead  
      75     \Drupal calls should be avoided in classes, use dependency injection instead  
      81     \Drupal calls should be avoided in classes, use dependency injection instead  
      97     \Drupal calls should be avoided in classes, use dependency injection instead  
      98     \Drupal calls should be avoided in classes, use dependency injection instead  
      121    \Drupal calls should be avoided in classes, use dependency injection instead  
      122    \Drupal calls should be avoided in classes, use dependency injection instead  
     ------ ------------------------------------------------------------------------------ 
    
     ------ -------------------------------------------------------------------------------------------------------------------- 
      Line   src/Plugin/TabType/NodeContent.php                                                                                  
     ------ -------------------------------------------------------------------------------------------------------------------- 
      35     \Drupal calls should be avoided in classes, use dependency injection instead                                        
      60     \Drupal calls should be avoided in classes, use dependency injection instead                                        
      62     Method Drupal\quicktabs\Plugin\TabType\NodeContent::render() should return string but return statement is missing.  
      64     \Drupal calls should be avoided in classes, use dependency injection instead                                        
      70     \Drupal calls should be avoided in classes, use dependency injection instead                                        
     ------ -------------------------------------------------------------------------------------------------------------------- 
    
     ------ ------------------------------------------------------------------------------ 
      Line   src/Plugin/TabType/QtabsContent.php                                           
     ------ ------------------------------------------------------------------------------ 
      27     \Drupal calls should be avoided in classes, use dependency injection instead  
      48     \Drupal calls should be avoided in classes, use dependency injection instead  
     ------ ------------------------------------------------------------------------------ 
    
     ------ ------------------------------------------------------------------------------ 
      Line   src/Plugin/TabType/ViewContent.php                                            
     ------ ------------------------------------------------------------------------------ 
      76     \Drupal calls should be avoided in classes, use dependency injection instead  
      81     \Drupal calls should be avoided in classes, use dependency injection instead  
      86     \Drupal calls should be avoided in classes, use dependency injection instead  
      89     \Drupal calls should be avoided in classes, use dependency injection instead  
      102    \Drupal calls should be avoided in classes, use dependency injection instead  
      180    \Drupal calls should be avoided in classes, use dependency injection instead  
     ------ ------------------------------------------------------------------------------ 
    
     ------ -------------------------------------------------------------------------------------------------------------------- 
      Line   src/Plugin/views/style/Quicktabs.php                                                                                
     ------ -------------------------------------------------------------------------------------------------------------------- 
      5      Interface Drupal\Core\Form\FormStateInterface referenced with incorrect case: Drupal\core\form\FormStateInterface.  
     ------ -------------------------------------------------------------------------------------------------------------------- 
    
                                                                                                                            
     [ERROR] Found 29 errors                                                                                                
                                                                                                                            
    
    
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia lavanyatalwar

    Working on it.

  • ๐Ÿ‡ธ๐Ÿ‡ฌSingapore anish.a Singapore

    @lavanyatalwar It is already being worked on by @rahul_ in DrupalCon Singapore and he is already in finishing stages. I suggest to take up another issue to avoid duplicate work.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rahul_ Alirajpur

    I am still working on this, will continue for another 24 hours.

    Till Now -
    I fixed most of the Errors mentioned above, and only a few are remaining, once I fix them tomorrow, and test the module, I will mark PR as ready for review.

    ddev . phpstan analyze web/modules/contrib/quicktabs

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Following up on this, would like to include in the release.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rahul_ Alirajpur

    Still working on this.

  • ๐Ÿ‡ธ๐Ÿ‡ฌSingapore anish.a Singapore

    @rahul_ Can you push the WIP in the branch, so that I can take a look.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rahul_ Alirajpur

    @anish.a you can continue from scratch, because due to some mistake, all my code is reverted :(.

  • ๐Ÿ‡ธ๐Ÿ‡ฌSingapore anish.a Singapore

    I am taking this up. I will push the changes on what I had done by today itself.

  • Merge request !29Issue #3492949: Address PHPSTAN issues โ†’ (Merged) created by anish.a
  • Pipeline finished with Success
    4 months ago
    Total: 158s
    #372602
  • ๐Ÿ‡ธ๐Ÿ‡ฌSingapore anish.a Singapore

    Created a draft MR. I still need to fix the dependency injection errors, continuing the work.

  • ๐Ÿ‡ธ๐Ÿ‡ฌSingapore anish.a Singapore

    Changing the status and assigning to me as I am continuing working on this.

  • Pipeline finished with Failed
    4 months ago
    Total: 152s
    #372765
  • Pipeline finished with Failed
    4 months ago
    Total: 252s
    #373167
  • ๐Ÿ‡ธ๐Ÿ‡ฌSingapore anish.a Singapore

    I had submitted a rough draft and I need some help on finishing it.

  • Pipeline finished with Failed
    4 months ago
    Total: 165s
    #373638
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Thanks all

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024